Bug #47187 Inserting 4 million rows not possible InnoDB
| Submitted: | 8 Sep 2009 7:45 | Modified: | 20 Jul 2010 10:01 |
|---|---|---|---|
| Reporter: | Susanne Ebrecht | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: InnoDB storage engine | Severity: | S1 (Critical) |
| Version: | 5.1 | OS: | Linux (Ubuntu amd64) |
| Assigned to: | Susanne Ebrecht | CPU Architecture: | Any |
| Tags: | regression | ||
[8 Sep 2009 7:45]
Susanne Ebrecht
[8 Sep 2009 7:46]
Susanne Ebrecht
I have to test the workaround
[8 Sep 2009 8:51]
Giuseppe Maxia
It probably depends on how much memory is allocated to innodb_buffer_pool_size
### On Linux, using 5.1.33 (innodb_buffer_pool_size=5G)
mysql [localhost] {msandbox} (test) > insert into t(j) select j+1 from t;
Query OK, 2097152 rows affected (14.99 sec)
Records: 2097152 Duplicates: 0 Warnings: 0
mysql [localhost] {msandbox} (test) > insert into t(j) select j+1 from t;
Query OK, 4194304 rows affected (30.10 sec)
Records: 4194304 Duplicates: 0 Warnings: 0
mysql [localhost] {msandbox} (test) > insert into t(j) select j+1 from t;
Query OK, 8388608 rows affected (1 min 0.60 sec)
Records: 8388608 Duplicates: 0 Warnings: 0
mysql [localhost] {msandbox} (test) > insert into t(j) select j+1 from t;
Query OK, 16777216 rows affected (2 min 1.28 sec)
Records: 16777216 Duplicates: 0 Warnings: 0
mysql [localhost] {msandbox} (test) > insert into t(j) select j+1 from t;
Query OK, 33554432 rows affected (3 min 55.71 sec)
Records: 33554432 Duplicates: 0 Warnings: 0
### On Mac OSX, using 5.1.37 (innodb_buffer_pool_size=1G)
mysql [localhost] {msandbox} (test) > insert into t(j) select j+1 from t;
Query OK, 2097152 rows affected (31.47 sec)
Records: 2097152 Duplicates: 0 Warnings: 0
mysql [localhost] {msandbox} (test) > insert into t(j) select j+1 from t;
Query OK, 4194304 rows affected (1 min 3.73 sec)
Records: 4194304 Duplicates: 0 Warnings: 0
mysql [localhost] {msandbox} (test) > insert into t(j) select j+1 from t;
Query OK, 8388608 rows affected (2 min 37.00 sec)
Records: 8388608 Duplicates: 0 Warnings: 0
mysql [localhost] {msandbox} (test) > insert into t(j) select j+1 from t;
Query OK, 16777216 rows affected (4 min 49.50 sec)
Records: 16777216 Duplicates: 0 Warnings: 0
[8 Sep 2009 9:14]
Susanne Ebrecht
It seems to be a regression because it works fine with older versions. The workaround here is to: ALTER TABLE tab ENGINE=MyISAM; Insert the data ALTER TABLE tab ENGINE=INNODB;
[8 Sep 2009 11:30]
Giuseppe Maxia
What earlier versions behave differently? I did this test: out of the box, I tried the above instructions on 5.0.84 and 5.1.39, without any buffer increase. They behave the same way. On my Mac OSX laptop, I can insert 4 million records, and I get the message about too many locks when I try to insert 8 million. But the result is the same on both versions, 5.0 and 5.1. On Linux, I can only insert 2 million records without errors 0n 5.1.39, but the same is true for 5.0.84. Moreover, the workaround is simple: add memory to innodb_buffer_pool_size, and you can insert up to 67 million records (It could be more, but 67 million is where I stopped looking)
[8 Sep 2009 13:44]
Peter Laursen
With 64 bit Windows server (5.1.38) running on Windows7 with those InnoDB options: innodb_additional_mem_pool_size=3M innodb_flush_log_at_trx_commit=1 innodb_log_buffer_size=2M innodb_buffer_pool_size=107M innodb_log_file_size=54M (all this was configured by the configuration instance wizard) .. I get for same SHOW VARIABLES LIKE 'innodb_buffer_pool_size'; -- 112197632 CREATE TABLE t(i SERIAL, j INTEGER) ENGINE=INNODB; INSERT INTO t(j) VALUES(1); INSERT INTO t(j) SELECT j+1 FROM t; .. .. INSERT INTO t(j) SELECT j+1 FROM t; -- success (2097152 row(s) affected) INSERT INTO t(j) SELECT j+1 FROM t; -- success (4194304 row(s) affected) INSERT INTO t(j) SELECT j+1 FROM t; -- success (8388608 row(s) affected) INSERT INTO t(j) SELECT j+1 FROM t; -- success (16777216 row(s) affected) INSERT INTO t(j) SELECT j+1 FROM t; -- success (33554432 row(s) affected) .. and note this was a ~100M Innodb_buffer_pool_size only. So I do not find the correlation to innodb_buffer_pool_size as assumed by Guiseppe. Seems not the only thing at least.
[8 Sep 2009 16:13]
Calvin Sun
Susanne, Could you please provide the old version you tested? Will you be able to insert more rows after increasing the buffer pool size? There is a possibility that sizes of internal data structures increase over time, but should not change too much. Thanks, Calvin
[8 Sep 2009 19:04]
Peter Laursen
With hindsight I should probably have told that I am not using the new InnoDB plugin!
[8 Oct 2009 23:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[20 Jul 2010 10:01]
Susanne Ebrecht
I will close this because I am not able anymore to follow my own thoughts.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.060 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.