MySQL Forums
Forum List  »  MyISAM

Re: Composite index
Posted by: Rick James
Date: August 29, 2016 11:34PM

I don't see the PRIMARY KEY in the table definition. It is picking that.

If this were InnoDB (which should be faster because of the clustering of the PK), the secondary key would be slower. It could be that the Optimizer is assuming InnoDB, hence the bias toward the PK.

Instead of "select id,cookie", you could do simply "SELECT 1" -- all you need to know is a yes/no answer.

Are most 'users' validated? That is, how often do you expect this query to 'fail'?

After a user is validated, how many more SQL queries will he perform? I am suggesting that this query is only a small fraction of the total activity, but you are treating it as if that is virtually the only thing to worry about.

Options: ReplyQuote

Written By
August 26, 2016 05:44PM
August 27, 2016 01:55PM
August 28, 2016 06:18AM
Re: Composite index
August 29, 2016 11:34PM
August 30, 2016 03:16AM
August 31, 2016 04:48PM

Sorry, you can't reply to this topic. It has been closed.
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.

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.