Re: Avoid repeated PQfnumber() in pg_dump - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Avoid repeated PQfnumber() in pg_dump
Date
Msg-id 170AF83E-4A58-4AFF-A9C4-ED6896FD94F4@yesql.se
Whole thread Raw
In response to RE: Avoid repeated PQfnumber() in pg_dump  ("houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>)
Responses Re: Avoid repeated PQfnumber() in pg_dump
List pgsql-hackers
> On 15 Jul 2021, at 04:51, houzj.fnst@fujitsu.com wrote:
> On July 15, 2021 5:35 AM Daniel Gustafsson <daniel@yesql.se> wrote:

>> Out of curiosity, how many columns are "many columns"?
>
> I tried dump 10 table definitions while each table has 1000 columns
> (maybe not real world case).

While unlikely to be common, very wide tables aren’t unheard of.  Either way, I
think it has merit to pull out the PQfnumber before the loop even if it’s a
wash performance wise for many users, as it’s a pattern used elsewhere in
pg_dump.

--
Daniel Gustafsson        https://vmware.com/




pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: CREATE COLLATION - check for duplicate options and error out if found one
Next
From: Mark Dilger
Date:
Subject: data corruption hazard in reorderbuffer.c