From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Corey Huinker <corey(dot)huinker(at)gmail(dot)com> |
Cc: | Jeff Davis <pgsql(at)j-davis(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Michael Paquier <michael(at)paquier(dot)xyz>, jian he <jian(dot)universality(at)gmail(dot)com>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Stephen Frost <sfrost(at)snowman(dot)net>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, alvherre(at)alvh(dot)no-ip(dot)org |
Subject: | Re: Statistics Import and Export |
Date: | 2025-02-24 01:14:16 |
Message-ID: | 1227872.1740359656@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Corey Huinker <corey(dot)huinker(at)gmail(dot)com> writes:
> If we're fine with giving up on appendNamedArgument() for relstats,
> wouldn't we also want to mash these into a single call?
> appendPQExpBuffer(out, "\t'relation', '%s'::regclass,\n", qualname);
> appendPQExpBuffer(out, "\t'version', '%u'::integer,\n",
> fout->remoteVersion);
> appendPQExpBuffer(out, "\t'relpages', '%d'::integer,\n", rsinfo->relpages);
> appendPQExpBuffer(out, "\t'reltuples', '%s'::real,\n", reltuples_str);
> appendPQExpBuffer(out, "\t'relallvisible', '%d'::integer\n);\n",
> rsinfo->relallvisible);
> to:
> appendPQExpBuffer(out, "\t'relation', '%s'::regclass"
> ",\n\t'version', '%u'::integer"
> ",\n\t'relpages', '%d'::integer"
> ",\n\t'reltuples', '%s'::real"
> ",\n\t'relallvisible', '%d'::integer",
> qualname, fout->remoteVersion, rsinfo->relpages,
> rsinfo->reltuples_str, rsinfo->relallvisible);
> appendPQExpBufferStr(out, "\n);\n");
That doesn't seem like an improvement. It's less readable ---
you have to match up %'s with arguments that are some distance
away --- and harder to modify. There might be some microscopic
performance benefit but it'd be pretty microscopic.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | wenhui qiu | 2025-02-24 01:48:18 | Anti join confusion |
Previous Message | Michael Paquier | 2025-02-24 01:05:26 | Re: Fix logging for invalid recovery timeline |