Yes, that's the trick. Thank Rudy and Gavin. Best, Jia
On Mon, Apr 5, 2010 at 2:13 PM, Gavin Towey <gto...@ffn.com> wrote: > Union does a distinct on all results. UNION ALL will avoid that. > > Regards, > Gavin Towey > > -----Original Message----- > From: chen.1...@gmail.com [mailto:chen.1...@gmail.com] On Behalf Of chen jia > Sent: Monday, April 05, 2010 11:07 AM > To: mysql@lists.mysql.com > Subject: Slow Union Statement > > Hi there, > > I run simple statement like this: > > create table c > select * from a > union > select * from b; > > where table a has 90,402,534 rows, and table b has 33,358,725 rows. > Both tables have the same three variables. > > It's taken a long time, more than half an hour now. How do I make it faster? > > Best, > Jia > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=gto...@ffn.com > > > This message contains confidential information and is intended only for the > individual named. If you are not the named addressee, you are notified that > reviewing, disseminating, disclosing, copying or distributing this e-mail is > strictly prohibited. Please notify the sender immediately by e-mail if you > have received this e-mail by mistake and delete this e-mail from your system. > E-mail transmission cannot be guaranteed to be secure or error-free as > information could be intercepted, corrupted, lost, destroyed, arrive late or > incomplete, or contain viruses. The sender therefore does not accept > liability for any loss or damage caused by viruses or errors or omissions in > the contents of this message, which arise as a result of e-mail transmission. > [FriendFinder Networks, Inc., 220 Humbolt court, Sunnyvale, CA 94089, USA, > FriendFinder.com > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=arch...@jab.org