Re: Avoid repeated PQfnumber() in pg_dump

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Avoid repeated PQfnumber() in pg_dump
Date: 2021-07-14 21:34:51
Message-ID: BFCCF27A-59D1-40C5-A3B7-751A52762DE3@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 14 Jul 2021, at 10:54, houzj(dot)fnst(at)fujitsu(dot)com wrote:

> Since PQfnumber() is not a cheap function, I think we'd better invoke
> PQfnumber() out of the loop like the attatched patch.

Looks good on a quick readthrough, and I didn't see any other similar codepaths
in pg_dump on top of what you've fixed.

> After applying this change, I can see about 8% performance gain in my test environment
> when dump table definitions which have many columns.

Out of curiosity, how many columns are "many columns"?

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-07-14 21:42:10 Re: automatically generating node support functions
Previous Message Andrew Dunstan 2021-07-14 20:28:13 Re: Quick tip on building pg with Visual Studio Build Tools 2019 + small patches