Skip to Content
Former Member
Dec 09, 2011 at 01:44 AM

index of select a, max(b) from t on a large table


hi, experts

I have a huge table containing 100M records, and I am going to run below SQL on it,

select a, max(b) from t group by a.

fields a and b are not key fields. my question is, I need to (option 1)create an index containing fields A and B, or (option 2)create an index for A and also create an index for B? which one is better?