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

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: random() (was Re: New GUC to sample log queries)
Дата
Msg-id CAH2-Wz=MGrJ5G-FtKVDnWzVuj6P2imQ3QTydex2fDgQGHXfdew@mail.gmail.com
обсуждение исходный текст
Ответ на Re: random() (was Re: New GUC to sample log queries)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: random() (was Re: New GUC to sample log queries)  (Peter Geoghegan <pg@bowt.ie>)
Список pgsql-hackers
On Wed, Dec 26, 2018 at 11:31 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
 > I've used setseed() to make nbtree's "getting tired" behavior
> > deterministic for specific test cases I've developed -- the random()
> > choice of whether to split a page full of duplicates, or continue
> > right in search of free space becomes predictable.

> TBH, I'd call it a bug --- maybe even a low-grade security hazard
> --- that it's possible to affect that from user level.

I don't disagree with that conclusion. Deterministic behavior is
always preferable to random behavior when the randomness is not truly
necessary.

> There might well be debugging value in affecting internal PRNG usages,
> but let's please not think it's a good idea that that's trivially
> reachable from SQL.

I hesitate to say that there is much value beyond the value that I've
found in this one instance. Maybe the remaining cases where this
technique could be applied just aren't very interesting.

-- 
Peter Geoghegan


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

Предыдущее
От: John Naylor
Дата:
Сообщение: Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: random() (was Re: New GUC to sample log queries)