From b12fd41c695b43c76b0a9a4d19ba43b05536440c Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Thu, 9 Jun 2016 12:40:23 -0400 Subject: Don't generate parallel paths for rels with parallel-restricted outputs. Such paths are unsafe. To make it cheaper to detect when this case applies, track whether a relation's default PathTarget contains any non-Vars. In most cases, the answer will be no, which enables us to determine cheaply that the target list for a proposed path is parallel-safe. However, subquery pull-up can create cases that require us to inspect the target list more carefully. Amit Kapila, reviewed by me. --- src/include/nodes/relation.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/include/nodes/relation.h') diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h index 88669f38765..b2b204693f7 100644 --- a/src/include/nodes/relation.h +++ b/src/include/nodes/relation.h @@ -490,6 +490,8 @@ typedef struct RelOptInfo /* default result targetlist for Paths scanning this relation */ struct PathTarget *reltarget; /* list of Vars/Exprs, cost, width */ + bool reltarget_has_non_vars; /* true if any expression in + * PathTarget is a non-Var */ /* materialization information */ List *pathlist; /* Path structures */ -- cgit v1.2.3