Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDZbu-0002qe-C0 for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Jul 2022 22:53:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oDZbs-0001WM-JD for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Jul 2022 22:53:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDZbs-0001VU-7c for pgsql-hackers@lists.postgresql.org; Mon, 18 Jul 2022 22:53:04 +0000 Received: from mout-b-105.mailbox.org ([195.10.208.50]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDZbk-0004j9-Ul for pgsql-hackers@lists.postgresql.org; Mon, 18 Jul 2022 22:53:02 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-b-105.mailbox.org (Postfix) with ESMTPS id 4Lmy0d1BFvz9sm5; Tue, 19 Jul 2022 00:52:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aboutsource.net; s=MBO0001; t=1658184769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SoQjBooja/LQmi7Ny5QTYtVvDFWPxuYBX2KGZdWXXvg=; b=eCch84sWv2UQCS1SjFsWTPhunQWiH0R56KECzRHWSFzrY98uLwf+bEEo9LFfPIrNW/s4Eg MIXyTgsXb5t5DQao2MtLV+kDM84e98JOaR3L5qNhOWBm45LIPgq8bXItvrd51Q6jtAoMz+ re0K5t013vKsf+YFfMtp4mqXcbDFWVIPPhJ5ejN6K1RR/8vtG6jbqaHdV63rS7fbDfC1x8 fDm5bFi5hJBHeOPXH3BrKPxmnXtILgFYNOqa1nxH13mfcFfgfo0gJwS4/lhUwWDup36gk4 kl8DZADaBxdjDSzXccSxMz7CEjIm5XJbdrOHqrkYpQfSWwJOHn50ydb6K/3ipQ== Message-ID: Date: Tue, 19 Jul 2022 00:52:47 +0200 MIME-Version: 1.0 Content-Language: de-DE To: Tom Lane Cc: Robert Haas , John Naylor , Thomas Munro , PostgreSQL Hackers References: <9d160a44-7675-51e8-60cf-6d64b76db831@aboutsource.net> <4073858.1658027909@sss.pgh.pa.us> <4077925.1658029046@sss.pgh.pa.us> <5ef15c6f-e108-53af-3d82-587fac394f1a@aboutsource.net> <463181.1658097987@sss.pgh.pa.us> <5b7a1ee9-f942-2502-3a0c-e9fc12511139@aboutsource.net> <469954.1658100033@sss.pgh.pa.us> <687490.1658152096@sss.pgh.pa.us> <1708d95a-629e-5ac5-deab-d20a8d0b2b0e@aboutsource.net> <809171.1658176490@sss.pgh.pa.us> <817328.1658178181@sss.pgh.pa.us> <0b5dea2b-37fa-6c81-ea9d-0341ab6f87d6@aboutsource.net> <840271.1658182720@sss.pgh.pa.us> From: Martin Kalcher Subject: Re: [PATCH] Introduce array_shuffle() and array_sample() In-Reply-To: <840271.1658182720@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Am 19.07.22 um 00:18 schrieb Tom Lane: > > Independently of the dimensionality question --- I'd imagined that > array_sample would select a random subset of the array elements > but keep their order intact. If you want the behavior shown > above, you can do array_shuffle(array_sample(...)). But if we > randomize it, and that's not what the user wanted, she has no > recourse. > > Now, if you're convinced that the set of people wanting > sampling-without-shuffling is the empty set, then making everybody > else call two functions is a loser. But I'm not convinced. > At the least, I'd like to see the argument made why nobody > would want that. > On the contrary! I am pretty sure there are people out there wanting sampling-without-shuffling. I will think about that.