MySQL Forums
Forum List  »  Quality Assurance

Why SELECT ... UNION is so SLOW ?
Posted by: Gérard LEMENN
Date: February 13, 2008 04:15AM

Hello,

I have 2 tables : T1 and T2 containing 2 columns : (a,b) , which are indexed.


I really can't figure out why :

SELECT a,b FROM T1 UNION SELECT a,b FROM T2

is much much slower than :

SELECT a,b FROM T1 GROUP BY a,b UNION SELECT a,b FROM T2 GROUP BY a,b

although both have same results. Is this a bug in the query optimizer ?

Options: ReplyQuote


Subject
Views
Written By
Posted
Why SELECT ... UNION is so SLOW ?
3473
February 13, 2008 04:15AM


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.