pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Martin Kalcher <martin.kalcher@aboutsource.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>
Cc: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: John Naylor <john.naylor@enterprisedb.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: [PATCH] Introduce array_shuffle() and array_sample()
Date: Wed, 28 Sep 2022 12:40:31 +0200
Message-ID: <9cd0925c-9839-a136-c21d-87de9e8a3aa4@aboutsource.net> (raw)
In-Reply-To: <3502301.1664223385@sss.pgh.pa.us>
References: <CAEZATCVOJHxWOG7DvEjkL_Y-h6f-HK-VkFpsdP76pa6y7xsW7Q@mail.gmail.com>
	<459f6008-90bc-bc52-6f11-e68570e03ac0@aboutsource.net>
	<CAEZATCXCFyr_cpkMygqSiiiHXgZWaXSumwL9=Xz5n7wwzBvaEw@mail.gmail.com>
	<583b6409-df52-86d1-8c0a-ce8e74863ad7@aboutsource.net>
	<036ba529-1f25-d7b5-c5ad-e6c852d928df@aboutsource.net>
	<alpine.DEB.2.22.394.2207240929220.1359119@pseudo>
	<f5af7698-d1eb-bdf4-9969-82b18ab4f8cf@aboutsource.net>
	<alpine.DEB.2.22.394.2207242132460.1359119@pseudo>
	<fe7a6a81-5c1b-aaae-922f-cb86be324373@aboutsource.net>
	<8fabf9e7-3422-58b0-93f6-d0976d4679df@aboutsource.net>
	<20220922152320.ukx6teo7wa7cuwkv@awork3.anarazel.de>
	<193caac5-941e-58b8-65e6-351f777ebd25@aboutsource.net>
	<3502301.1664223385@sss.pgh.pa.us>

Am 26.09.22 um 22:16 schrieb Tom Lane:
> 
> With our current PRNG infrastructure it doesn't cost much to have
> a separate PRNG for every purpose.  I don't object to having
> array_shuffle() and array_sample() share one PRNG, but I don't
> think it should go much further than that.
> 

Thanks for your thoughts, Tom. I have a couple of questions. Should we 
introduce a new seed function for the new PRNG state, used by 
array_shuffle() and array_sample()? What would be a good name? Or should 
those functions use pg_global_prng_state? Is it safe to assume, that 
pg_global_prng_state is seeded?

Martin





view thread (51+ messages)  latest in thread

Message-ID: <9cd0925c-9839-a136-c21d-87de9e8a3aa4@aboutsource.net>
Permalink:  ../9cd0925c-9839-a136-c21d-87de9e8a3aa4@aboutsource.net/
Also on:    postgresql.org/message-id/9cd0925c-9839-a136-c21d-87de9e8a3aa4@aboutsource.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: martin.kalcher@aboutsource.net, tgl@sss.pgh.pa.us, andres@anarazel.de, coelho@cri.ensmp.fr, dean.a.rasheed@gmail.com, robertmhaas@gmail.com, andrew@dunslane.net, john.naylor@enterprisedb.com, thomas.munro@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: [PATCH] Introduce array_shuffle() and array_sample()
  In-Reply-To: <9cd0925c-9839-a136-c21d-87de9e8a3aa4@aboutsource.net>
  References: <CAEZATCVOJHxWOG7DvEjkL_Y-h6f-HK-VkFpsdP76pa6y7xsW7Q@mail.gmail.com> <459f6008-90bc-bc52-6f11-e68570e03ac0@aboutsource.net> <CAEZATCXCFyr_cpkMygqSiiiHXgZWaXSumwL9=Xz5n7wwzBvaEw@mail.gmail.com> <583b6409-df52-86d1-8c0a-ce8e74863ad7@aboutsource.net> <036ba529-1f25-d7b5-c5ad-e6c852d928df@aboutsource.net> <alpine.DEB.2.22.394.2207240929220.1359119@pseudo> <f5af7698-d1eb-bdf4-9969-82b18ab4f8cf@aboutsource.net> <alpine.DEB.2.22.394.2207242132460.1359119@pseudo> <fe7a6a81-5c1b-aaae-922f-cb86be324373@aboutsource.net> <8fabf9e7-3422-58b0-93f6-d0976d4679df@aboutsource.net> <20220922152320.ukx6teo7wa7cuwkv@awork3.anarazel.de> <193caac5-941e-58b8-65e6-351f777ebd25@aboutsource.net> <3502301.1664223385@sss.pgh.pa.us> <9cd0925c-9839-a136-c21d-87de9e8a3aa4@aboutsource.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox