Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1956

Whether Multiple index on Single table is necessary!?? (no replies)

$
0
0
Hi,
I have table with 60 columns. and its a huge table having more than 1 crore records.

mysql>desc dummy_table;
col1 int
col2 varchar(10)
col2 datetime
.
.
.
col60 int


i have two select queries from this table.

1. select col1,col4,col5 from dummy_table where col1=1 and col6=8 and col10='abc';

2. select col21,col30,col50,col51 from dummy_table where col1=1 and col6=8 and col10='abc' and col20='123' and col13='12';


Now my doubt is whether i have to create two different index for above queries :

create index dummy_table_index1 on dummy_table (col1,col6,col10);

create index dummy_table_index1 on dummy_table (col1,col6,col10,col20,col13);

OR
Single Index is enough :

create index dummy_table_index1 on dummy_table (col1,col6,col10,col20,col13);

because second index includes all columns from first and second query.


Please suggest.

Thanks,
Akshath

Viewing all articles
Browse latest Browse all 1956

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>