pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Call set_rel_pathlist_hook before generate_gather_paths, not aft
4+ messages / 1 participants
[nested] [flat]

* pgsql: Call set_rel_pathlist_hook before generate_gather_paths, not aft
@ 2019-02-09 16:41  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2019-02-09 16:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Call set_rel_pathlist_hook before generate_gather_paths, not after.

The previous ordering of these steps satisfied the nominal requirement
that set_rel_pathlist_hook could editorialize on the whole set of Paths
constructed for a base relation.  In practice, though, trying to change
the set of partial paths was impossible.  Adding one didn't work because
(a) it was too late to be included in Gather paths made by the core code,
and (b) calling add_partial_path after generate_gather_paths is unsafe,
because it might try to delete a path it thinks is dominated, but that
is already embedded in some Gather path(s).  Nor could the hook safely
remove partial paths, for the same reason that they might already be
embedded in Gathers.

Better to call extensions first, let them add partial paths as desired,
and then gather.  In v11 and up, we already doubled down on that ordering
by postponing gathering even further for single-relation queries; so even
if the hook wished to editorialize on Gather path construction, it could
not.

Report and patch by KaiGai Kohei.  Back-patch to 9.6 where Gather paths
were added.

Discussion: https://postgr.es/m/CAOP8fzahwpKJRTVVTqo2AE=mDTz_efVzV6Get_0=U3SO+-ha1A@mail.gmail.com

Branch
------
REL_10_STABLE

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

Modified Files
--------------
doc/src/sgml/custom-scan.sgml         |  5 +++--
src/backend/optimizer/path/allpaths.c | 27 ++++++++++++++++-----------
2 files changed, 19 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Call set_rel_pathlist_hook before generate_gather_paths, not aft
@ 2019-02-09 16:41  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2019-02-09 16:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Call set_rel_pathlist_hook before generate_gather_paths, not after.

The previous ordering of these steps satisfied the nominal requirement
that set_rel_pathlist_hook could editorialize on the whole set of Paths
constructed for a base relation.  In practice, though, trying to change
the set of partial paths was impossible.  Adding one didn't work because
(a) it was too late to be included in Gather paths made by the core code,
and (b) calling add_partial_path after generate_gather_paths is unsafe,
because it might try to delete a path it thinks is dominated, but that
is already embedded in some Gather path(s).  Nor could the hook safely
remove partial paths, for the same reason that they might already be
embedded in Gathers.

Better to call extensions first, let them add partial paths as desired,
and then gather.  In v11 and up, we already doubled down on that ordering
by postponing gathering even further for single-relation queries; so even
if the hook wished to editorialize on Gather path construction, it could
not.

Report and patch by KaiGai Kohei.  Back-patch to 9.6 where Gather paths
were added.

Discussion: https://postgr.es/m/CAOP8fzahwpKJRTVVTqo2AE=mDTz_efVzV6Get_0=U3SO+-ha1A@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6401583863eaf83624994908911350b03f9978ae

Modified Files
--------------
doc/src/sgml/custom-scan.sgml         |  5 +++--
src/backend/optimizer/path/allpaths.c | 25 ++++++++++++++-----------
2 files changed, 17 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Call set_rel_pathlist_hook before generate_gather_paths, not aft
@ 2019-02-09 16:41  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2019-02-09 16:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Call set_rel_pathlist_hook before generate_gather_paths, not after.

The previous ordering of these steps satisfied the nominal requirement
that set_rel_pathlist_hook could editorialize on the whole set of Paths
constructed for a base relation.  In practice, though, trying to change
the set of partial paths was impossible.  Adding one didn't work because
(a) it was too late to be included in Gather paths made by the core code,
and (b) calling add_partial_path after generate_gather_paths is unsafe,
because it might try to delete a path it thinks is dominated, but that
is already embedded in some Gather path(s).  Nor could the hook safely
remove partial paths, for the same reason that they might already be
embedded in Gathers.

Better to call extensions first, let them add partial paths as desired,
and then gather.  In v11 and up, we already doubled down on that ordering
by postponing gathering even further for single-relation queries; so even
if the hook wished to editorialize on Gather path construction, it could
not.

Report and patch by KaiGai Kohei.  Back-patch to 9.6 where Gather paths
were added.

Discussion: https://postgr.es/m/CAOP8fzahwpKJRTVVTqo2AE=mDTz_efVzV6Get_0=U3SO+-ha1A@mail.gmail.com

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/027b5a300a9e9b407f465f0264cb88305eb0539d

Modified Files
--------------
doc/src/sgml/custom-scan.sgml         |  5 +++--
src/backend/optimizer/path/allpaths.c | 25 ++++++++++++++-----------
2 files changed, 17 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Call set_rel_pathlist_hook before generate_gather_paths, not aft
@ 2019-02-09 16:41  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2019-02-09 16:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Call set_rel_pathlist_hook before generate_gather_paths, not after.

The previous ordering of these steps satisfied the nominal requirement
that set_rel_pathlist_hook could editorialize on the whole set of Paths
constructed for a base relation.  In practice, though, trying to change
the set of partial paths was impossible.  Adding one didn't work because
(a) it was too late to be included in Gather paths made by the core code,
and (b) calling add_partial_path after generate_gather_paths is unsafe,
because it might try to delete a path it thinks is dominated, but that
is already embedded in some Gather path(s).  Nor could the hook safely
remove partial paths, for the same reason that they might already be
embedded in Gathers.

Better to call extensions first, let them add partial paths as desired,
and then gather.  In v11 and up, we already doubled down on that ordering
by postponing gathering even further for single-relation queries; so even
if the hook wished to editorialize on Gather path construction, it could
not.

Report and patch by KaiGai Kohei.  Back-patch to 9.6 where Gather paths
were added.

Discussion: https://postgr.es/m/CAOP8fzahwpKJRTVVTqo2AE=mDTz_efVzV6Get_0=U3SO+-ha1A@mail.gmail.com

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6257f525aff4e711d7eb5405626e7eeac37e2ff5

Modified Files
--------------
doc/src/sgml/custom-scan.sgml         |  5 +++--
src/backend/optimizer/path/allpaths.c | 27 ++++++++++++++++-----------
2 files changed, 19 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2019-02-09 16:41 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-02-09 16:41 pgsql: Call set_rel_pathlist_hook before generate_gather_paths, not aft Tom Lane <tgl@sss.pgh.pa.us>
2019-02-09 16:41 pgsql: Call set_rel_pathlist_hook before generate_gather_paths, not aft Tom Lane <tgl@sss.pgh.pa.us>
2019-02-09 16:41 pgsql: Call set_rel_pathlist_hook before generate_gather_paths, not aft Tom Lane <tgl@sss.pgh.pa.us>
2019-02-09 16:41 pgsql: Call set_rel_pathlist_hook before generate_gather_paths, not aft Tom Lane <tgl@sss.pgh.pa.us>

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