Skip to content

Instantly share code, notes, and snippets.

@kovid-rathee
Last active January 15, 2023 20:47
Show Gist options
  • Save kovid-rathee/32e91738faa1ca15f14aef7c7e22c593 to your computer and use it in GitHub Desktop.
Save kovid-rathee/32e91738faa1ca15f14aef7c7e22c593 to your computer and use it in GitHub Desktop.
mysqlslap Scripts for Testing Insert Performance in MySQL WITH and WITHOUT primary keys
mysqlslap --create-schema="tests" \
--concurrency=4 \
--query="insert into test_inserts_with_primary_key select null id, md5(rand()) text_field_1, md5(rand()) text_field_2, curdate() - interval round(rand() * 200) day created_at" \n
--number-of-queries=10000000 \
--iterations=1 \
-uroot -p
mysqlslap --create-schema="tests" \
--concurrency=4 \
--query="insert into test_inserts_with_primary_key select 10129 id, md5(rand()) text_field_1, md5(rand()) text_field_2, curdate() - interval round(rand() * 200) day created_at" \n
--number-of-queries=10000000 \
--iterations=1 \
-uroot -p
@demisx
Copy link

demisx commented Jan 15, 2023

Can you please post DDL for the tables?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment