Re: Proposal to introduce a shuffle function to intarray extension

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Martin Kalcher <martin(dot)kalcher(at)aboutsource(dot)net>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Proposal to introduce a shuffle function to intarray extension
Date: 2022-07-17 03:36:48
Message-ID: CAKFQuwZ19DYu1pdfsCqkjHbKh103vOGky2u8PTV23d4k=UnK6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Sat, Jul 16, 2022 at 8:18 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Martin Kalcher <martin(dot)kalcher(at)aboutsource(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2022-07-17 03:37:26 Re: Proposal to introduce a shuffle function to intarray extension
Previous Message David G. Johnston 2022-07-17 03:32:34 Re: Proposal to introduce a shuffle function to intarray extension

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-07-17 03:37:26 Re: Proposal to introduce a shuffle function to intarray extension
Previous Message David G. Johnston 2022-07-17 03:32:34 Re: Proposal to introduce a shuffle function to intarray extension