MySQL Forums
Forum List  »  Newbie

Re: subtle performance question - simple query
Posted by: Sandro Frattura
Date: July 17, 2014 11:30AM

FYI. A response I got from a colleague on this (academic) question.

Hmm, I assume a trick question here --- but, based on what you provided, considering userFrom and userTo is a primary key, meaning you are querying against that specific, unique, row, the queries should be exactly the same, and one is not more efficient than the other.

Unless there’s an index on isRead and the optimizer is being completed HORRIBLE and using that index instead of the primary key. But that should not happen.

As far as when an update is happening or not, well, in the case where an update is not happening, it will still perform the action of looking it up, but it will realize that no changes need to happen so the data files need no change.

Options: ReplyQuote


Subject
Written By
Posted
Re: subtle performance question - simple query
July 17, 2014 11:30AM


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.