Re: UNIONs faster than simple ORs
Posted by:
Rick James
Date: September 06, 2008 10:44PM
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 changed the subject because JOIN is not what the UNION is competing with.)
Subject
Views
Written By
Posted
12560
September 04, 2008 10:12AM
Re: UNIONs faster than simple ORs
3042
September 06, 2008 10:44PM
3202
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.