Critters wrote:

Hi
I have a database with just over 10,000 records. with the following structure:
id, compid, name, score, and about 10 other fields

I have indexed id, compid, score
about 10 records out of the 10,000 have a compid of 2

when i do

select * from table where compid = 2

it was slow until i indexed the compid and now is <1 second, but

select * from table where compid = 2 order by score

This should use the index on compid to select the 10 rows, then do a filesort to order them...


takes around 15 seconds and has alot of HDD activiry.

but that shouldn't take this long.

Any way to speed this up? its driving me nuts.

Try

  ANALYZE TABLE your_table_name;

to make sure the index stats are up to date, then try again. If it's still slow, run EXPLAIN <http://dev.mysql.com/doc/mysql/en/EXPLAIN.html> on your query and post the results.

--
Dave

Michael

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to