Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t8qkF-006Jnm-MS for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Nov 2024 00:51:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t8qkD-00ASgT-2V for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Nov 2024 00:51:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t8qkC-00ASgC-74 for pgsql-hackers@lists.postgresql.org; Thu, 07 Nov 2024 00:51:29 +0000 Received: from m16.mail.163.com ([117.135.210.5]) by makus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t8qk7-000YJC-6a for pgsql-hackers@lists.postgresql.org; Thu, 07 Nov 2024 00:51:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version: Content-Type; bh=Ceurfcim6+vVIQOHl0gzqfz9wUYfXuUM9VEG/0kBaDI=; b=FmtHZzlFlffwaRo4bRL8wDEdGF8/PgcUjFrAUMh6KILLTYqeQR7MQ1EiXt8kL4 ylxq36FlixK1YNb5cW1zAndzcY09vg1KnP4p/rVYEUCTVaY3zkWCxjtvBBMRhRJF 9xvorgHCVymbM2mCKJsSAatJh3yO78gWdsCWi72XIPtTg= Received: from lovely-coding (unknown [101.227.46.166]) by gzga-smtp-mtada-g0-4 (Coremail) with SMTP id _____wDH5S0DDyxnog0RFg--.49040S3; Thu, 07 Nov 2024 08:51:16 +0800 (CST) From: Andy Fan To: Aleksander Alekseev Cc: Postgres hackers , Dean Rasheed , Japin Li , Jim Jones Subject: Re: New function normal_rand_array function to contrib/tablefunc. In-Reply-To: (Aleksander Alekseev's message of "Tue, 5 Nov 2024 20:35:31 +0300") References: <87plssezpc.fsf@163.com> <87v814wmz0.fsf@163.com> <87plpv1rb0.fsf@163.com> <87le0iqrsu.fsf@163.com> <87zfox2rx7.fsf@163.com> <87ed68gcym.fsf@163.com> <87ldyojxwg.fsf@163.com> <87ses7rfc2.fsf@163.com> Date: Thu, 07 Nov 2024 08:51:15 +0800 Message-ID: <87zfmbq324.fsf@163.com> MIME-Version: 1.0 Content-Type: text/plain X-CM-TRANSID: _____wDH5S0DDyxnog0RFg--.49040S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7Zw4kAr1DCF4UKFyfJrW5Wrg_yoW8Wryfpa yrK3Z09rsrJr45Cry8ZayrX34Fk395Jay5X395J34DCw45Jryvv3Z7Kw4Yqa4j9F1vyF10 qF12yrn8ZanxAFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07U4rW7UUUUU= X-Originating-IP: [101.227.46.166] X-CM-SenderInfo: x2klx3xlid0iqsrtqiywtou0bp/1tbioAuQU2csCSdGogABso List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, Looks I miss some interesting dicussions in the recent days, the pretty neat API random_array, random_array or array_random (I prefer the random_array because of the setseed stuff as Dean said). These dicussions absoluatly enrichs my API / decoument design experience. I'm still not sure if it should be put into core, I agree that random_array/array_random should be put into core if we go with this way. It looks to me that the cost of putting them into core is just it takes more OIDs in initdb, hence making catalog a bit of bigger, not sure the real matter of it. As for if we should support random_array_multidim at the first step, as a developer, I would like to try dim sutff since I have little experience on this area, It is possible that this area bring some other interesting experience for me as the things happen to me recently. > I suggest implementing the function in several steps. First implement > random_array(min, max, len). It's straightforward and IMO will provide > the most value to the majority of the users.Then we can either add an > optional argument or a random_array_multidim() function. This may doubles the OID expence, every invariants needs 3 OIDs(int, bigint, numeric). > This can be > implemented and discussed as a separate patch. This approach would be > convenient for the author and the reviewers and also will allow us to > deliver value to the users sooner. Appricated for your suggestion like this, Aleksander, I can understand your kindly intention! If no new ideas, I will defer to Dean's final decision for efficient purpose. -- Best Regards Andy Fan