List:General Discussion« Previous MessageNext Message »
From:mos Date:October 6 2006 8:33pm
Subject:MySQL 5 query takes 100x longer than MySQL 4.1.10
View as plain text  
I have a simple query in MySQL 5.0.24:

insert into table1 (col1) select distinct col1 from bigtable;

that will run for 1:14:18. Both tables are MyISAM and table1 was just 
created with 2 columns and is empty.

The "select distinct col1 from bigtable" takes only 2 minutes to run if I 
run it by itself (without the Insert statement), so why does inserting it 
into Table1 take over an hour? This worked fine under MySQL 4.1.10

BigTable has 30 million rows in it and will return approx 7000 distinct values.

TIA

Mike
Thread
MySQL 5 query takes 100x longer than MySQL 4.1.10mos6 Oct
  • Re: MySQL 5 query takes 100x longer than MySQL 4.1.10Dan Buettner7 Oct
    • Re: MySQL 5 query takes 100x longer than MySQL 4.1.10mos7 Oct
  • Re: MySQL 5 query takes 100x longer than MySQL 4.1.10Angelo Zanetti7 Oct
    • Re: Re: MySQL 5 query takes 100x longer than MySQL 4.1.10Dan Buettner9 Oct