From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: James Coleman <jtc331@gmail.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Rafia Sabih <rafia.pghackers@gmail.com>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Shaun Thomas <shaun.thomas@2ndquadrant.com>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Cc: andreas@proxel.se
Subject: Re: [PATCH] Incremental sort (was: PoC: Partial sort)
Date: Mon, 23 Mar 2020 13:44:46 -0300
Message-ID: <20200323164446.GA6911@alvherre.pgsql> (raw)
In-Reply-To: <CAAaqYe9fNfj900_PAKKWX9FLEnTufRrLVz=ZmhO6Qw25YnMOHw@mail.gmail.com>
On 2020-Mar-22, James Coleman wrote:
> One question I have while I work on that: I've noticed some confusion
> in the patch as to whether we should refer to the node below the
> incremental sort node in the plan tree (i.e., the node we get tuples
> from) as the inner node or the outer node. Intuitively I'd expect to
> call it the inner node, but the original patch referred to it
> frequently as the outer node. The outerPlanState/innerPlanState macro
> comments don't offer a lot of clarification though they're "to avoid
> confusion" about right/left inner/outer. I suppose if the
> outerPlanState macro is working here the correct term should be outer?
I think the inner/outer distinction comes from join nodes wanting to
distinguish which child drives the scan of the other. If there's a
single child, there's no need to make such a distinction: it's just "the
child". And if it's the only child, conventionally we use the first
one, which conventionally is (for us westerners) the one on the left.
This view is supported by the fact that outerPlanState() appears 113
times in the code whereas innerPlanState() appears only 27 times --
that is, all plan types that use only one child use the outer one. They
could use either, as long as it does that consistently, I think.
Therefore the term should be "outer". It's not "outer" to the parent
incremental sort; it's just the "outer" of its two possible children.
I think.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@2ndquadrant.com, jtc331@gmail.com, tomas.vondra@2ndquadrant.com, michael@paquier.xyz, rafia.pghackers@gmail.com, pg@bowt.ie, simon@2ndquadrant.com, shaun.thomas@2ndquadrant.com, 9erthalion6@gmail.com, a.korotkov@postgrespro.ru, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org, andreas@proxel.se
Subject: Re: [PATCH] Incremental sort (was: PoC: Partial sort)
In-Reply-To: <20200323164446.GA6911@alvherre.pgsql>
* 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