MySQL Forums
Forum List  »  Optimizer & Parser

Re: index selection
Posted by: Rick James
Date: August 31, 2008 11:16PM

It depends on the phase of the moon. ;)

No, seriously... I encounter this odd behavior occasionally. It always seems to be the case that either index might be equally efficient, but one might be more efficient if the block(s) it needs happen to be in cache at the moment.

This was a MyISAM table? PRIMARY and secondary indexes work the same way. If it had been InnoDB, it would not make sense to use anything but the PRIMARY KEY, because that would take it directly to the data.

Options: ReplyQuote


Subject
Views
Written By
Posted
6454
August 07, 2008 06:01AM
2594
August 07, 2008 07:07PM
2629
August 30, 2008 11:48AM
Re: index selection
2476
August 31, 2008 11:16PM


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.