MySQL Forums
Forum List  »  Optimizer & Parser

Re: At Performance Limit for 2 GB RAM?
Posted by: KimSeong Loh
Date: August 02, 2005 12:59AM

The 2 primary key are different
(`metadata_id`,`stn_id`,`dich_value`)
(stn_id, metadata_id, dich_value)

The 2nd is able to give you results very fast becasue it is sorted by the stn_id which is able to helps you get all the rows with stn_id = 2500. This should remove the using where in your explain.

Having this primary key may be even better
(stn_id, dich_value, etadata_id)
This will help the "group by dich_value" in your query. This may help remove the using temporary and using filesort in the explain.

Try it and see the difference in the explain result.

Options: ReplyQuote


Subject
Views
Written By
Posted
3295
August 04, 2005 07:17PM
Re: At Performance Limit for 2 GB RAM?
2812
August 02, 2005 12:59AM


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.