Re: UNIONs faster than simple ORs
Rick James Wrote:
-------------------------------------------------------
> A single SELECT will use no more than one index
> per table.
>
> A UNION will use no more than one index per SELECT
> in the union.
>
> Hence, the latter will make better use of indexes,
> as seen by the "Using index" in a lot of places in
> its EXPLAIN.
I see. And it explains why adding indexes to the mapping table did not improve performance.
Ok, I'll just drop the extra indexes and go with one UNION per-path.
> (I changed the subject because JOIN is not what
> the UNION is competing with.)
Indeed.
Thanks for the good explanation,
Mike
Subject
Views
Written By
Posted
12558
September 04, 2008 10:12AM
3042
September 06, 2008 10:44PM
Re: UNIONs faster than simple ORs
3201
September 09, 2008 12: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.