Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit aca127c

Browse files
committed
Prevent Parallel Hash Join for JOIN_UNIQUE_INNER.
WHERE EXISTS (...) queries cannot be executed by Parallel Hash Join with jointype JOIN_UNIQUE_INNER, because there is no way to make a partial plan totally unique. The consequence of allowing such plans was duplicate results from some EXISTS queries. Back-patch to 11. Bug #15857. Author: Thomas Munro Reviewed-by: Tom Lane Reported-by: Vladimir Kriukov Discussion: https://postgr.es/m/15857-d1ba2a64bce0795e%40postgresql.org
1 parent 0ab7110 commit aca127c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/backend/optimizer/path/joinpath.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -1867,9 +1867,12 @@ hash_inner_and_outer(PlannerInfo *root,
18671867

18681868
/*
18691869
* Can we use a partial inner plan too, so that we can build a
1870-
* shared hash table in parallel?
1870+
* shared hash table in parallel? We can't handle
1871+
* JOIN_UNIQUE_INNER because we can't guarantee uniqueness.
18711872
*/
1872-
if (innerrel->partial_pathlist != NIL && enable_parallel_hash)
1873+
if (innerrel->partial_pathlist != NIL &&
1874+
save_jointype != JOIN_UNIQUE_INNER &&
1875+
enable_parallel_hash)
18731876
{
18741877
cheapest_partial_inner =
18751878
(Path *) linitial(innerrel->partial_pathlist);

0 commit comments

Comments
 (0)