Re: Statistics Import and Export - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Statistics Import and Export
Date
Msg-id 1227872.1740359656@sss.pgh.pa.us
Whole thread Raw
In response to Re: Statistics Import and Export  (Corey Huinker <corey.huinker@gmail.com>)
List pgsql-hackers
Corey Huinker <corey.huinker@gmail.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



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Fix logging for invalid recovery timeline
Next
From: wenhui qiu
Date:
Subject: Anti join confusion