MySQL Forums
Forum List  »  Performance

Re: long running, can't get to use index
Posted by: Øystein Grøvlen
Date: March 27, 2017 02:04AM

Hi Eric,

To access the least amount of rows, you should have an index on (r_userid, r_create_tm), in that order.

Even if you are not able to able to use index hints in production, I suggest to use hints to investigate what would be the best index to use. Optimizer trace should give a hint as to why the best index is not chosen.

For tables that are larger than the buffer pool, it may also help to force MRR by setting optimizer_switch='mrr_cost_based=off'.

Øystein Grøvlen,
Senior Principal Software Engineer,
MySQL Group, Oracle,
Trondheim, Norway

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: long running, can't get to use index
93
March 27, 2017 02:04AM


Sorry, only registered users may post in this forum.

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.