Search Postgresql Archives

Fwd: Sequence vs UUID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Copying the list...

---------- Forwarded message ---------
From: Dominique Devienne <ddevienne@xxxxxxxxx>
Date: Fri, Feb 3, 2023 at 4:57 PM
Subject: Re: Sequence vs UUID
To: veem v <veema0000@xxxxxxxxx>

On Thu, Feb 2, 2023 at 8:47 PM veem v <veema0000@xxxxxxxxx> wrote:
Tested the UUIDv7 generator for postgres as below. 
With regards to performance , It's still way behind the sequence. [...]
explain analyze  select count(nextval('myseq') ) from generate_series(1,100000);
Execution Time: 59.687 ms

explain analyze  select count(gen_random_uuid()) from generate_series(1,100'000);
Execution Time: 904.868 ms

explain analyze  select count(uuid_generate_v7()) from generate_series(1,100000);
Execution Time: 1711.187 ms

Something's off regarding Guid generations IMHO...

You generate 100K Guids in ~1s. While we generate (in C++, Windows Release, using Boost) 16M of them in +/- the same time:

Enabling Performance tests
 
generate 16'000'000 guids in 0.980s (user: 0.984s) 12 MB
generate 16'000'000 guids in parallel on 4 CPUs in 0.309s (user: 1.188s) 12 MB

That's 2 orders of magnitude faster. Sure there's some overhead from the SQL, but still. Something seems fishy.
And that's on a 2.5y old desktop. --DD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux