We are planning to migrate our project from MySql to Postgres. We need Guid as primary key. Some of our table need to insert bulk data. We have noticed slow performance while using UUID in postgres. Below sql is taking 16 sec. to generate 10K uuids
select uuid_generate_v4() from generate_series(1,10000)
Whereas Mysql is taking 700 ms. to generate 100K GUIDs.
I am missing something ??
Environment :
Postgres11 on Windows 10
Could you try using the function provided by pgcrypto as stated in the help page (scroll to the very bottom).
The following query was executed in less than 120 ms on my computer
select gen_random_uuid() from generate_series(1,10000)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With