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
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
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
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