MySQL Forums
Forum List  »  Optimizer & Parser

Re: Why does this query take 2 minutes?
Posted by: KimSeong Loh
Date: February 02, 2005 07:36PM

MySQL optimiser choosed to use the index 'hid' to find for rows having value 'petit'.

For each row having the value of 'petit', mysql reads the whole data row and check for the rest of the condition.

If you want to speed up this query, try to create a composite index (hid,hcreationtimestamp,hresultid)
Then MySQL will be able to count from the index without reading the data rows.

Options: ReplyQuote


Subject
Views
Written By
Posted
3421
February 02, 2005 10:39AM
Re: Why does this query take 2 minutes?
2327
February 02, 2005 07:36PM
2049
February 03, 2005 07:21AM
2143
February 03, 2005 08:34PM
2200
February 03, 2005 08:43PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.