MySQL Forums
Forum List  »  Newbie

Test data for performance
Posted by: Sud s
Date: February 03, 2023 12:40AM

Hello Experts, We want to test the performance of a sequence vs UUID(version-7) on mysql database. Something similar to below in postgres. Not able to see an easy way to create data volume easily and also 'explain analyze' seems not working. Can you please guide me here?

Below code works in postgres and I want to mimic the code similar to below in mysql, to test the performance of UUID vs sequence for generation, INSERT and Querying.

CREATE UNLOGGED TABLE test_bigint ( id bigint PRIMARY KEY);
CREATE UNLOGGED TABLE test_uuid7 ( id uuid PRIMARY KEY);
create sequence myseq cache 32767;

explain analyze select count(nextval('myseq') ) from generate_series(1,100000);
explain analyze select count(gen_random_uuid()) from generate_series(1,100000);
explain analyze select count(uuid_generate_v7()) from generate_series(1,100000);

*************** Insert Test***************
explain analyze INSERT INTO test_bigint select nextval('myseq') from generate_series(1,100000);
explain analyze INSERT INTO test_uuid select gen_random_uuid() from generate_series(1,100000);
explain analyze INSERT INTO test_uuid7 select uuid_generate_v7() from generate_series(1,100000);

************ Index performance********
Explain analyze select * from test_bigint where id in (select id from test_bigint limit 1000);
Explain analyze select * from test_uuid where id in (select id from test_uuid limit 1000);
Explain analyze select * from test_uuid7 where id in (select id from test_uuid7 limit 1000);

Options: ReplyQuote


Subject
Written By
Posted
Test data for performance
February 03, 2023 12:40AM
February 08, 2023 04:56AM


Sorry, you can't reply to this topic. It has been closed.

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.