pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix testing of parallel-safety of SubPlans.
3+ messages / 2 participants
[nested] [flat]

* pgsql: Fix testing of parallel-safety of SubPlans.
@ 2017-04-18 19:44 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2017-04-18 19:44 UTC (permalink / raw)
  To: pgsql-committers

Fix testing of parallel-safety of SubPlans.

is_parallel_safe() supposed that the only relevant property of a SubPlan
was the parallel safety of the referenced subplan tree.  This is wrong:
the testexpr or args subtrees might contain parallel-unsafe stuff, as
demonstrated by the test case added here.  However, just recursing into the
subtrees fails in a different way: we'll typically find PARAM_EXEC Params
representing the subplan's output columns in the testexpr.  The previous
coding supposed that any Param must be treated as parallel-restricted, so
that a naive attempt at fixing this disabled parallel pushdown of SubPlans
altogether.  We must instead determine, for any visited Param, whether it
is one that would be computed by a surrounding SubPlan node; if so, it's
safe to push down along with the SubPlan node.

We might later be able to extend this logic to cope with Params used for
correlated subplans and other cases; but that's a task for v11 or beyond.

Tom Lane and Amit Kapila

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/39151781c8cd2c8bf6057496426fb9c07178eda5

Modified Files
--------------
src/backend/optimizer/util/clauses.c          | 44 ++++++++++++++++++++++++---
src/include/nodes/primnodes.h                 |  3 +-
src/test/regress/expected/select_parallel.out | 12 ++++++++
src/test/regress/sql/select_parallel.sql      |  4 +++
4 files changed, 57 insertions(+), 6 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Fix testing of parallel-safety of scan/join target.
@ 2019-03-12 07:41 Etsuro Fujita <efujita@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Etsuro Fujita @ 2019-03-12 07:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix testing of parallel-safety of scan/join target.

In commit 960df2a971 ("Correctly assess parallel-safety of tlists when
SRFs are used."), the testing of scan/join target was done incorrectly,
which caused a plan-quality problem.  Backpatch through to v11 where
the aforementioned commit went in, since this is a regression from v10.

Author: Etsuro Fujita
Reviewed-by: Robert Haas and Tom Lane
Discussion: https://postgr.es/m/5C75303E.8020303@lab.ntt.co.jp

Branch
------
master

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

Modified Files
--------------
src/backend/optimizer/plan/planner.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



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

* pgsql: Fix testing of parallel-safety of scan/join target.
@ 2019-03-12 07:41 Etsuro Fujita <efujita@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Etsuro Fujita @ 2019-03-12 07:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix testing of parallel-safety of scan/join target.

In commit 960df2a971 ("Correctly assess parallel-safety of tlists when
SRFs are used."), the testing of scan/join target was done incorrectly,
which caused a plan-quality problem.  Backpatch through to v11 where
the aforementioned commit went in, since this is a regression from v10.

Author: Etsuro Fujita
Reviewed-by: Robert Haas and Tom Lane
Discussion: https://postgr.es/m/5C75303E.8020303@lab.ntt.co.jp

Branch
------
REL_11_STABLE

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

Modified Files
--------------
src/backend/optimizer/plan/planner.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



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


end of thread, other threads:[~2019-03-12 07:41 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-04-18 19:44 pgsql: Fix testing of parallel-safety of SubPlans. Tom Lane <tgl@sss.pgh.pa.us>
2019-03-12 07:41 pgsql: Fix testing of parallel-safety of scan/join target. Etsuro Fujita <efujita@postgresql.org>
2019-03-12 07:41 pgsql: Fix testing of parallel-safety of scan/join target. Etsuro Fujita <efujita@postgresql.org>

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