Re: Statistics Import and Export
| От | Tom Lane |
|---|---|
| Тема | Re: Statistics Import and Export |
| Дата | |
| Msg-id | 1227872.1740359656@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Statistics Import and Export (Corey Huinker <corey.huinker@gmail.com>) |
| Список | 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 по дате отправления: