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 1oDD9x-0003jR-P9 for pgsql-hackers@arkaria.postgresql.org; Sun, 17 Jul 2022 22:54:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oDD8y-0001HT-Fu for pgsql-hackers@arkaria.postgresql.org; Sun, 17 Jul 2022 22:53:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDD8y-0001DY-6g for pgsql-hackers@lists.postgresql.org; Sun, 17 Jul 2022 22:53:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDD8w-0004ID-26 for pgsql-hackers@lists.postgresql.org; Sun, 17 Jul 2022 22:53:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 26HMrVc9464382; Sun, 17 Jul 2022 18:53:31 -0400 From: Tom Lane To: Thomas Munro cc: Martin Kalcher , PostgreSQL Hackers Subject: Re: Proposal to introduce a shuffle function to intarray extension In-reply-to: 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> Comments: In-reply-to Thomas Munro message dated "Mon, 18 Jul 2022 10:37:04 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <464380.1658098411.1@sss.pgh.pa.us> Date: Sun, 17 Jul 2022 18:53:31 -0400 Message-ID: <464381.1658098411@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thomas Munro writes: > Seems OK for a worst case. It must still be a lot faster than doing > it in SQL. Now I wonder what the exact requirements would be to > dispatch to a faster version that would handle int4. I find it impossible to believe that it's worth micro-optimizing shuffle() to that extent. Now, maybe doing something in that line in deconstruct_array and construct_array would be worth our time, as that'd benefit a pretty wide group of functions. regards, tom lane