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 1soBmD-00918x-M9 for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Sep 2024 01:04:11 +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 1soBlD-005iYL-H2 for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Sep 2024 01:03:07 +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 1soBlC-005iYD-EV for pgsql-hackers@lists.postgresql.org; Wed, 11 Sep 2024 01:03:07 +0000 Received: from m16.mail.163.com ([117.135.210.3]) by makus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1soBl5-000Y7G-DS for pgsql-hackers@postgresql.org; Wed, 11 Sep 2024 01:03:03 +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=T/Xi2MCzeRJVtikk+5IOkd3Dh94Sq8ShALtLTYRlP5M=; b=JNT7sKRioQTb2UpmmbRKmo/nanOsAWgvCezCehgdaChJHdBQ8PIbeIrrYjGrVG tIoJBI41IJ7tZqNCaKoXfnMNk1HzvgDQNXZcSJzgDuu2FnYihl54DDAJfxQ/VHj7 5e0wyM+V6C4jS6RFXrt+7pfLdbI3zNhOFuoi/RB7uaSYk= Received: from lovely-coding (unknown [219.151.176.141]) by gzga-smtp-mta-g2-4 (Coremail) with SMTP id _____wDX7z067OBm8_keAw--.59443S3; Wed, 11 Sep 2024 09:02:51 +0800 (CST) From: Andy Fan To: Andreas Karlsson Cc: David Rowley , pgsql-hackers , Tom Lane Subject: Re: Make printtup a bit faster In-Reply-To: (Andreas Karlsson's message of "Fri, 30 Aug 2024 18:20:39 +0200") References: <87wmjzfz0h.fsf@163.com> Date: Wed, 11 Sep 2024 09:02:50 +0800 Message-ID: <87wmjj80jp.fsf@163.com> MIME-Version: 1.0 Content-Type: text/plain X-CM-TRANSID: _____wDX7z067OBm8_keAw--.59443S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7XF17JF15uw1xGr1DZr4UCFg_yoWkZFg_Aa 4DGF98Ww45Aw17GF4jkr45ZF47Gr47GFyDG345XrsaqFy7A39rZ34kJrZ29w1fZ3yUtrnI k3sakr42kr13GjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUUJ3v5UUUUU== X-Originating-IP: [219.151.176.141] X-CM-SenderInfo: x2klx3xlid0iqsrtqiywtou0bp/xtbBZwJWU2V4JHcEuQABsS List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello David & Andreas, > On 8/29/24 1:51 PM, David Rowley wrote: >> I had planned to work on this for PG18, but I'd be happy for some >> assistance if you're willing. > > I am interested in working on this, unless Andy Fan wants to do this > work. :) I believe that optimizing the out, in and send functions would > be worth the pain. I get Tom's objections but I do not think adding a > small check would add much overhead compared to the gains we can get. Just to be clearer, I'd like work on the out function only due to my internal assignment. (Since David planned it for PG18, so it is better say things clearer eariler). I'd put parts of out(print) function refactor in the next 2 days. I think it deserves a double check before working on *all* the out function. select count(*), count(distinct typoutput) from pg_type; count | count -------+------- 621 | 97 (1 row) select typoutput, count(*) from pg_type group by typoutput having count(*) > 1 order by 2 desc; typoutput | count -----------------+------- array_out | 296 record_out | 214 multirange_out | 6 range_out | 6 varcharout | 3 int4out | 2 timestamptz_out | 2 nameout | 2 textout | 2 (9 rows) -- Best Regards Andy Fan