| Bug #9676 | INSERT INTO x SELECT .. FROM x LIMIT 1; slows down with big tables | ||
|---|---|---|---|
| Submitted: | 6 Apr 2005 13:57 | Modified: | 6 Jul 2006 21:02 |
| Reporter: | Alexander Keremidarski | ||
| Status: | Closed | ||
| Category: | Server: Optimizer | Severity: | S3 (Non-critical) |
| Version: | 4.1 | OS: | Any (any) |
| Assigned to: | Georgi Kodinov | Target Version: | |
[6 Apr 2005 13:57]
Alexander Keremidarski
[13 Apr 2005 17:04]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/23970
[18 May 2005 15:10]
Pekka Nousiainen
Patch not ok, update status.
[15 Jun 2006 17:23]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/7710
[21 Jun 2006 15:35]
Georgi Kodinov
The problem was that when filling up the temp table in statements like : insert into t1(x) select 1 from t1 limit 1; the temp table was getting all the rows of t1. Corrected to store no more than LIMIT rows (if applicable) into the temp table.
[6 Jul 2006 17:34]
Evgeny Potemkin
Currently in INSERT ... SELECT ... LIMIT ... the compiler uses a temporary table to store the results of SELECT ... LIMIT .. and then uses that table as a source for INSERT. The problem is that in some cases it actually skips the LIMIT clause in doing that and materializes the whole SELECT result set regardless of the LIMIT. Fixed in 4.1.21, 5.0.24, 5.1.12
[6 Jul 2006 21:02]
Paul DuBois
Noted in 4.1.21, 5.0.24, 5.1.12 changelogs.
[13 Jul 2006 5:37]
Paul DuBois
5.0.x fix went to 5.0.25 instead.
[25 Jun 2007 23:49]
Bugs System
Pushed into 5.1.21-beta
[25 Jun 2007 23:51]
Bugs System
Pushed into 5.0.46
