Re: query performance optimization
Rick James Wrote:
> Øystein -- I used to say " OR clauses tend to
> prevent usage of indexes" for things like
> (SAM.admin_user_id IS NULL OR
> SAM.admin_user_id='24577')
> But then I discovered "ref_or_null". However, it
> does not seem to be used in his case. Can you
> elaborate?
You are right. ref_and_null can be used for conditions like above. However, I am not quite sure what happens in this case where you have an additional join condition on another column. Anyhow, EXPLAIN show that there is only one row in this table. I guess that is why an index is not used.
Øystein Grøvlen,
Senior Principal Software Engineer,
MySQL Group, Oracle,
Trondheim, Norway
Subject
Views
Written By
Posted
2236
January 18, 2016 04:49AM
917
January 19, 2016 02:30AM
879
January 19, 2016 02:50AM
1628
January 19, 2016 06:24AM
1002
January 22, 2016 06:29PM
Re: query performance optimization
1005
January 29, 2016 04:37AM
1325
January 22, 2016 06:18AM
891
January 27, 2016 06:56AM
877
January 22, 2016 01:08PM
977
January 22, 2016 11:10PM
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.