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 <[email protected]>
Reviewed-by: Nathan Bossart <[email protected]>
Discussion: 
https://postgr.es/m/os0pr01mb57164c392783f29f6d0eca0b94...@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(-)

Reply via email to