Re: random() (was Re: New GUC to sample log queries)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: random() (was Re: New GUC to sample log queries)
Дата
Msg-id 21086.1545859306@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: random() (was Re: New GUC to sample log queries)  (Peter Geoghegan <pg@bowt.ie>)
Ответы Re: random() (was Re: New GUC to sample log queries)  (Peter Geoghegan <pg@bowt.ie>)
Список pgsql-hackers
Peter Geoghegan <pg@bowt.ie> writes:
> On Wed, Dec 26, 2018 at 12:19 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Replacing random() might actually make that easier not harder, since
>> we'd have more control over what happens when.

> That does seem useful. I'm in favor. But why does the function to seed
> the internal PRNG have to be loadable? Can't it just be
> superuser-only?

That'd work as far as I'm concerned.  (But I can hear Frost wanting
a built-in role for it ;-))

One thing we'd have to think about if we want to take this seriously
is whether a process-wide PRNG state is really adequate; if you're
trying to make a particular call site be deterministic, you'd likely
wish it weren't interfered with by other call sites.  On the flip
side, having more call sites probably makes things more random and
thus better for normal usage.  Not sure how to resolve that tension
(but I don't want to build a whole lot of new infrastructure here).

            regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Feature: temporary materialized views
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Shared Memory: How to use SYSV rather than MMAP ?