pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Gustafsson <dgustafsson@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid invoking PQfnumber in loop constructs
Date: Fri, 27 Aug 2021 14:25:25 +0000
Message-ID: <E1mJcnN-00043p-Gl@gemulon.postgresql.org> (raw)

Avoid invoking PQfnumber in loop constructs

When looping over the resultset from a SQL query, extracting the field
number before the loop body to avoid repeated calls to PQfnumber is an
established pattern.  On very wide tables this can have a performance
impact, but it wont be noticeable in the common case. This fixes a few
queries which were extracting the field number in the loop body.

Author: Hou Zhijie <houzj.fnst@fujitsu.com>
Reviewed-by: Nathan Bossart <bossartn@amazon.com>
Discussion: https://postgr.es/m/OS0PR01MB57164C392783F29F6D0ECA0B94139@OS0PR01MB5716.jpnprd01.prod.outlook.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d782d5987e1022ba70171bcf3507cd87564ef23c

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 94 +++++++++++++++++++++++++++++++++++------------
1 file changed, 71 insertions(+), 23 deletions(-)



Message-ID: <E1mJcnN-00043p-Gl@gemulon.postgresql.org>
Permalink:  ../E1mJcnN-00043p-Gl@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mJcnN-00043p-Gl@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: dgustafsson@postgresql.org
  Subject: Re: pgsql: Avoid invoking PQfnumber in loop constructs
  In-Reply-To: <E1mJcnN-00043p-Gl@gemulon.postgresql.org>
  References: <E1mJcnN-00043p-Gl@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox