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


Subject
Views
Written By
Posted
2380
August 26, 2016 05:44PM
1213
August 27, 2016 01:55PM
1259
August 28, 2016 06:18AM
Re: Composite index
1472
August 29, 2016 11:34PM
1288
August 30, 2016 03:16AM
1194
August 31, 2016 04:48PM


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.