Re: Slow Union Statement

2010-04-05 Thread chen jia
to: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; >

RE: Slow Union Statement

2010-04-05 Thread Gavin Towey
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

Re: Slow Union Statement

2010-04-05 Thread Rudy Lippan
On 04/05/2010 02:06 PM, chen jia wrote: > 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 ti

Slow Union Statement

2010-04-05 Thread chen jia
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, Ji