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,

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 time, more

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

Re: Slow Union Statement

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

Re: slow in statement?

2008-11-10 Thread Ananda Kumar
it should not cause any issues, unless your passing too many values in id in(1,2,...n). Are the indexes present. On 11/10/08, Alex K [EMAIL PROTECTED] wrote: Hello, It seems to me that the statement id in (id1, id2 ... idn) is much slower than id=id1 or id=id2 ... or id=idn or I am doing

Re: slow in statement?

2008-11-10 Thread Alex K
Hi Ananda, Indexes are present. I'm passing no more 10 values. Alex 2008/11/10 Ananda Kumar [EMAIL PROTECTED]: it should not cause any issues, unless your passing too many values in id in(1,2,...n). Are the indexes present. On 11/10/08, Alex K [EMAIL PROTECTED] wrote: Hello, It seems

Re: slow in statement?

2008-11-10 Thread Ananda Kumar
can u please show me the explain plan for this sql and also the table structure explain select statement desc table_name On 11/10/08, Alex K [EMAIL PROTECTED] wrote: Hi Ananda, Indexes are present. I'm passing no more 10 values. Alex 2008/11/10 Ananda Kumar [EMAIL PROTECTED]: it

slow in statement?

2008-11-10 Thread Alex K
Hello, It seems to me that the statement id in (id1, id2 ... idn) is much slower than id=id1 or id=id2 ... or id=idn or I am doing something wrong? Thank you, Alex -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL

Re: slow in statement?

2008-11-10 Thread Alex K
Here we go: http://pastebin.com/m2439985d replace $company_ids by list of ids from 'companies' replace $neg_company_ids by -1 * $company_ids replace $location_ids by list of location ids from 'locations' replace $all_company_ids by list of ids from 'all_companies' The reason why I'm doing

Re: Speed up slow SQL statement.

2008-10-24 Thread Moon's Father
: Speed up slow SQL statement. Date: Fri, 26 Sep 2008 10:42:07 -0400 Good morning everyone, I've got a sql statement that is running quite slow. I've indexed everything I can that could possibly be applicable but I can't seem to speed it up. I've put up the table structures, row

Re: Speed up slow SQL statement.

2008-09-29 Thread Eric Stewart
distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. From: [EMAIL PROTECTED] To: mysql@lists.mysql.com Subject: Speed up slow SQL statement. Date: Fri, 26 Sep 2008 10:42:07 -0400 Good morning everyone, I've got

Re: Speed up slow SQL statement.

2008-09-29 Thread Rob Wultsch
this transmission. From: [EMAIL PROTECTED] To: mysql@lists.mysql.com Subject: Speed up slow SQL statement. Date: Fri, 26 Sep 2008 10:42:07 -0400 Good morning everyone, I've got a sql statement that is running quite slow. I've indexed everything I can that could possibly be applicable

Speed up slow SQL statement.

2008-09-26 Thread Eric Stewart
Good morning everyone, I've got a sql statement that is running quite slow. I've indexed everything I can that could possibly be applicable but I can't seem to speed it up. I've put up the table structures, row counts, the sql statement and the explain dump of the sql statement all in

RE: Speed up slow SQL statement.

2008-09-26 Thread Martin Gainty
content contained within this transmission. From: [EMAIL PROTECTED] To: mysql@lists.mysql.com Subject: Speed up slow SQL statement. Date: Fri, 26 Sep 2008 10:42:07 -0400 Good morning everyone, I've got a sql statement that is running quite slow. I've indexed everything I can that could