mysql-random-data-generator icon indicating copy to clipboard operation
mysql-random-data-generator copied to clipboard

Slow? It seems to only insert about 400 rows per second.

Open cbegin opened this issue 6 years ago • 5 comments

Generating 10,000 rows in a table of 10 columns of VARCHAR(25) plus an auto-increment int primary key (11 columns total). Hardware is very powerful. 4 core, 24GB RAM, on NVME drives (the hardware is actually much larger, but this is a container and those are the constraints).

Might I be doing something wrong? Or is that pretty typical?

cbegin avatar Nov 30 '18 06:11 cbegin

I was able to speed this up, and I'd be happy to share back the modifications if you like. But first, would you be willing to put up a clear license, preferably something like MIT: https://choosealicense.com/licenses/mit/#suggest-this-license

Cheers!

cbegin avatar Dec 04 '18 14:12 cbegin

Greetings Clinton,

I had plans & ideas to work on performance of the procedure trying out with delayed / bulk inserts. I'm fairly interested to know your changes leading improvements. Please share the fork/pull request. I added the MIT License.

Regards.

kedarvj avatar Dec 04 '18 15:12 kedarvj

I'd like to help this issue . I think ,if someone need lots of rows , it's more efficiently inert 1000 rows in one loop instead of insert one by one

kartist avatar Apr 29 '21 06:04 kartist

With encouragement from @kartist I have updated the script. Please review again.

kedarvj avatar May 02 '21 11:05 kedarvj

@kedarvj

MariaDB [db]> call populate('db', 'table', 1000000, 'N');
+---------------------+
| Developed by        |
+---------------------+
| Kedar Vaijanapurkar |
+---------------------+
1 row in set (1 hour 34 min 8.535 sec)

Query OK, 1001999 rows affected (1 hour 34 min 8.539 sec)

jetrodn avatar Oct 28 '21 14:10 jetrodn