pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Standardize some more loops that chase down parallel lists.
Date: Thu, 28 Feb 2019 19:25:11 +0000
Message-ID: <E1gzRIt-0000C9-UW@gemulon.postgresql.org> (raw)

Standardize some more loops that chase down parallel lists.

We have forboth() and forthree() macros that simplify iterating
through several parallel lists, but not everyplace that could
reasonably use those was doing so.  Also invent forfour() and
forfive() macros to do the same for four or five parallel lists,
and use those where applicable.

The immediate motivation for doing this is to reduce the number
of ad-hoc lnext() calls, to reduce the footprint of a WIP patch.
However, it seems like good cleanup and error-proofing anyway;
the places that were combining forthree() with a manually iterated
loop seem particularly illegible and bug-prone.

There was some speculation about restructuring related parsetree
representations to reduce the need for parallel list chasing of
this sort.  Perhaps that's a win, or perhaps not, but in any case
it would be considerably more invasive than this patch; and it's
not particularly related to my immediate goal of improving the
List infrastructure.  So I'll leave that question for another day.

Patch by me; thanks to David Rowley for review.

Discussion: https://postgr.es/m/11587.1550975080@sss.pgh.pa.us

Branch
------
master

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

Modified Files
--------------
src/backend/access/common/tupdesc.c    | 19 ++++-----------
src/backend/executor/execExpr.c        | 20 ++++------------
src/backend/executor/nodeIndexscan.c   | 28 +++++++++--------------
src/backend/optimizer/plan/subselect.c |  5 +---
src/backend/optimizer/prep/prepunion.c |  7 ++----
src/backend/parser/analyze.c           | 42 +++++++++++-----------------------
src/backend/parser/parse_func.c        |  7 +++---
src/backend/utils/adt/ruleutils.c      | 37 +++++++++---------------------
src/include/nodes/pg_list.h            | 26 +++++++++++++++++++++
9 files changed, 76 insertions(+), 115 deletions(-)



Message-ID: <E1gzRIt-0000C9-UW@gemulon.postgresql.org>
Permalink:  ../E1gzRIt-0000C9-UW@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gzRIt-0000C9-UW@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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Standardize some more loops that chase down parallel lists.
  In-Reply-To: <E1gzRIt-0000C9-UW@gemulon.postgresql.org>
  References: <E1gzRIt-0000C9-UW@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