Hi Again Thanks for all the responces
> Check the manual section on the query optimiser,.I seem to remember that if > MySQL has to check more that some percentage of a table (30% ?) the > optimiser guesses it can search the entire table just as quickly. > Someone please correct my if I'm wrong. > > Try 'select domain_id, count(*) from mailstat group by domain_id' to check the > distribution of your data. Hmm, well u r obviously right, its cos it thinks that there are so many '2's that it isnt using the index...only its wrong :( mysql> select domain_id,count(*) from mailstat group by domain_id limit 10; +-----------+----------+ | domain_id | count(*) | +-----------+----------+ | 0 | 1284985 | | 1 | 156373 | | 2 | 636675 | | 3 | 40187 | | 4 | 2712 | | 6 | 44 | | 7 | 5469 | | 8 | 9 | | 9 | 6 | | 10 | 10 | +-----------+----------+ 10 rows in set (8.21 sec) mysql> select count(*) from mailstat; +----------+ | count(*) | +----------+ | 2961765 | +----------+ 1 row in set (0.01 sec) The only value near 30% of the rows is a value of 0, and this value will never be queried for the reports, as the reports are for specific domains. I tried an analyze table on the mailstat table, but this didnt change anything.... Thanks for the help anyways. Cheers, Steve --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php