Re: Has gen_random_uuid() gotten much slower in v17? - Mailing list pgsql-performance

From David Mullineux
Subject Re: Has gen_random_uuid() gotten much slower in v17?
Date
Msg-id CAGsyd8W8oB5YqcDB=BUUn32XWGbt8x0UYO_WAJHFGcgX076tXg@mail.gmail.com
Whole thread Raw
In response to Re: Has gen_random_uuid() gotten much slower in v17?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance


On Wed, 20 Nov 2024, 22:26 Tom Lane, <tgl@sss.pgh.pa.us> wrote:
[ please don't top-quote, it makes the conversation hard to follow ]

David Mullineux <dmullx@gmail.com> writes:
> On Wed, 20 Nov 2024, 15:46 Tom Lane, <tgl@sss.pgh.pa.us> wrote:
>> Yeah.  Also, are you building with openssl, or not?

> No, not at all!

If you're not using openssl, then gen_random_uuid basically devolves
to a read of /dev/urandom.  Maybe you're using a different kernel
than before, and it has different properties around that?

                        regards, tom lane

Just to say, thanks Tom. You were dead right. From the code in 
pg_strong_random.c
it looks like each call will do an open("/dev/urandom")

And that cannot be fast.

Not sure why,but I guess there are good reasons to not keep a file descriptor to that device open across calls ?

Thanks anyway

pgsql-performance by date:

Previous
From: David Rowley
Date:
Subject: Re: CTE Inline On TPC-DS Query 95
Next
From: Sajjad Abid
Date:
Subject: Reg. Postgres Unique contraint