Re: [PATCH] Introduce array_shuffle() and array_sample()

Поиск
Список
Период
Сортировка
От Martin Kalcher
Тема Re: [PATCH] Introduce array_shuffle() and array_sample()
Дата
Msg-id 583b6409-df52-86d1-8c0a-ce8e74863ad7@aboutsource.net
обсуждение исходный текст
Ответ на Re: [PATCH] Introduce array_shuffle() and array_sample()  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Ответы Re: [PATCH] Introduce array_shuffle() and array_sample()  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Re: [PATCH] Introduce array_shuffle() and array_sample()  (Martin Kalcher <martin.kalcher@aboutsource.net>)
Список pgsql-hackers
Am 22.07.22 um 09:59 schrieb Dean Rasheed:>
> Option 1:
>   Keep random.c small
>   - Responsible for initialisation of the user prng on demand
>   - Expose the user prng state to other code like float.c and arrayfuncs.c
> 
> Option 2:
>   Move all random functions wanting to use the user prng to random.c
>   - Starting with drandom() and setseed()
>   - Then, array_shuffle() and array_sample()
>   - Later, any new SQL-callable random functions we might add
>   - Keep the user prng state local to random.c
> 

Hey Dean,

i came to the same conclusions and went with Option 1 (see patch). 
Mainly because most code in utils/adt is organized by type and this way 
it is clear, that this is a thin wrapper around pg_prng.

What do you think?
Вложения

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

Предыдущее
От: Matthias van de Meent
Дата:
Сообщение: Re: StrategyAM for IndexAMs
Следующее
От: Richard Guo
Дата:
Сообщение: Re: Add proper planner support for ORDER BY / DISTINCT aggregates