Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to choose correct index for group by data

user8629294Feb 27 2020 — edited Feb 27 2020

Hi ,

I am having a table having 249 columns and want to perform a group by on 20 columns .Its a history table which is getting inserted daily .

So there is no index on this table .My group by query is like below

select

          col1,col2,col2,col3....col20,count(0)

from t

  group by col1,col2,col2,col3....col20 ;

My question is that on which columns should i create index so that it will take less time .Currently the table ( t ) is having 112 crores of data .

Do i need to create index on all 20 cols .

Comments
Post Details
Added on Feb 27 2020
15 comments
2,170 views