Re: random() (was Re: New GUC to sample log queries) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: random() (was Re: New GUC to sample log queries)
Date
Msg-id 27584.1546045067@sss.pgh.pa.us
Whole thread Raw
In response to Re: random() (was Re: New GUC to sample log queries)  (Thomas Munro <thomas.munro@enterprisedb.com>)
Responses Re: random() (was Re: New GUC to sample log queries)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Thomas Munro <thomas.munro@enterprisedb.com> writes:
> I was going to suggest that we might be able to use a single
> not-visible-to-users number that is mixed into the existing recipe, so
> that we only ever read urandom once for the cluster.

Yeah, I was thinking along similar lines, but there's a problem:
InitProcessGlobals runs before an EXEC_BACKEND child has reconnected
to shared memory, so there's no cheap way to pass state to it.
No doubt there are ways around that, but I'd just as soon avoid
adding complexity here.  If we broke it somehow, the likely results
would be silent failure of the per-process seed to be random, which
might escape detection for a long time.

> But it sounds
> like it's not a problem, and it's probably better to just pass the
> whole problem over to the OS.

Yeah, that's what I'm thinking.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: random() (was Re: New GUC to sample log queries)
Next
From: Kohei KaiGai
Date:
Subject: Re: add_partial_path() may remove dominated path but still in use