Help with slow select count(*)

2001-02-21 Thread Kent Hoover
I see in your 'Explain's, the 2 queries use different indexes, the fast one uses soc_date_idx, and the slower one uses q_idx. The trick, perhaps is to force soc_date_idx to be used in the 2nd case. (Adding ORDER BY soc_date might do it, 'soc_date=X and (queue_id=Y and server_id=Z) ) might do

Help with slow select count(*)

2001-02-19 Thread Robin Keech
Hi, Can anyone please explain the following? I do two select count(*)'s from a big table, (21,000,000 + rows 6.5 Gb). All columns in the where are indexed. The first select is very quick, the second very slow. The ONLY difference is the value of one column variable (queue_id), which is an