Re: Make printtup a bit faster
Andy Fan <zhihuifan1213@163.com>
From: Andy Fan <zhihuifan1213@163.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>,
Tom Lane <tgl@sss.pgh.pa.us>
Date: 2026-05-03T14:41:27Z
Lists: pgsql-hackers
Hi David,
> On Fri, 30 Aug 2024 at 12:10, Andy Fan <zhihuifan1213@163.com> wrote:
>> What would be the extra benefit we redesign all the out functions?
>
> If I've understood your proposal correctly, it sounds like you want to
> invent a new "print" output function for each type to output the Datum
> onto a StringInfo, if that's the case, what would be the point of
> having both versions?
You understood me correctly and I thought we should maintain one version
two years ago, so I tried to implement this idea today. The first issue I
want to talk about now how to define the function protocol in SQL, take
int4out for example:
master: cstring int4out(integer);
New protocol: void int4out(integer, internal). and the internal is
StringInfo acutally.
The direct impaction would be:
master support:
postgres=# select int4out(8);
int4out
---------
8
(1 row)
After our change, user could not invoke any {type}out function anymore
in SQL since it takes 'internal' as an agrument. I am not sure if people
would write SQL like this, but it'd be good to have a talk about this.
--
Best Regards
Andy Fan