Question about index usage

2007-01-18 Thread Michaël de Groot
Hi guys, I have a question about index usage in MySQL. I have a query: MYSQL: ([EMAIL PROTECTED]) [webstats] EXPLAIN SELECT sum(users) as totaal_uniek, page_id FROM webstats.stats_hour where page_id LIKE 'vipPage_%' and site = 'spelpuntVip' and date 1166353093 group by page_id ORDER

Re: Question about index usage

2007-01-18 Thread Chris
Michaël de Groot wrote: Hi guys, I have a question about index usage in MySQL. I have a query: MYSQL: ([EMAIL PROTECTED]) [webstats] EXPLAIN SELECT sum(users) as totaal_uniek, page_id FROM webstats.stats_hour where page_id LIKE 'vipPage_%' and site = 'spelpuntVip' and date

Not a lame question about index usage of MySQL

2001-01-26 Thread Artem Koutchine
The manual says that if two seprate single-column indexes exist on two different colums (col1, col2) and someone issues a query: SELECT * FROM tbl_name WHERE col1=val1 AND col2=val2 optimizer will choose the index which matches the least records and use it. This is it. Manual does not say what

Re: Not a lame question about index usage of MySQL

2001-01-26 Thread Dan Nelson
In the last episode (Jan 26), Artem Koutchine said: The manual says that if two seprate single-column indexes exist on two different colums (col1, col2) and someone issues a query: SELECT * FROM tbl_name WHERE col1=val1 AND col2=val2 optimizer will choose the index which matches the least