Re: Proposal to introduce a shuffle function to intarray extension

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Proposal to introduce a shuffle function to intarray extension
Дата
Msg-id CAKFQuwZ19DYu1pdfsCqkjHbKh103vOGky2u8PTV23d4k=UnK6A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Proposal to introduce a shuffle function to intarray extension  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sat, Jul 16, 2022 at 8:18 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Martin Kalcher <martin.kalcher@aboutsource.net> writes:

> - I added a second function sample(), because it is a lot faster to take
>    some elements from an array than to shuffle the whole array and
>    slice it. This function can be removed if it is not wanted.

I have no opinion about whether this one is valuable enough to include in
intarray, but I do feel like sample() is a vague name, and easily confused
with marginally-related operations like TABLESAMPLE.  Can we think of a
more on-point name?  Something like "random_subset" would be pretty
clear, but it's also clunky.  It's too late here for me to think of
le mot juste...


choose(input anyarray, size integer, with_replacement boolean default false, algorithm text default 'default')?

David J.

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Proposal to introduce a shuffle function to intarray extension
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Proposal to introduce a shuffle function to intarray extension