Index on Group By Variables

Post Reply
foosh101
Posts: 61
Joined: Tue Oct 22, 2002 2:13 pm

Index on Group By Variables

Post by foosh101 »

Everything I have read and heard indicates that you should index any field that you do a 'where' or 'order by' on. Is this also true for 'group by's or does it not matter?
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

Index on Group By Variables

Post by John »

It depends on the rest of the query. If you are doing LIKE queries, putting the GROUP BY field as a compound field in the Metamorph index can help. Generally though a separate index on the field will not help much.
John Turnbull
Thunderstone Software
foosh101
Posts: 61
Joined: Tue Oct 22, 2002 2:13 pm

Index on Group By Variables

Post by foosh101 »

FYI - I added the GROUP BY field to my compound index, and it increased the speed of my search by over %500.
Post Reply