From 2c6e6471af9f5b6e4d1b25814a86a1dbd2eb928a Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Sun, 3 Jul 2016 16:55:27 -0400
Subject: [PATCH] Allow treating TABLESAMPLE scans as parallel-safe.

This was the intention all along, but an extraneous "return;" in
set_rel_consider_parallel() caused sampled rels to never be marked
consider_parallel.

Since we don't have any partial tablesample path/plan type yet, there's
no possibility of parallelizing the sample scan itself; but this fix
allows such a scan to appear below a parallel join, for example.
---
 src/backend/optimizer/path/allpaths.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index 2e4b670e069..535d2e69b2b 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -538,7 +538,6 @@ set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel,
 				if (has_parallel_hazard((Node *) rte->tablesample->args,
 										false))
 					return;
-				return;
 			}
 
 			/*
-- 
GitLab