Subject: [PATCH 06/10] review

From: Tomas Vondra <[email-masked]>
Date: Wed, 17 Mar 2021 02:19:56 +0100

---
 src/backend/optimizer/path/uniquekeys.c | 2 ++
 src/backend/optimizer/plan/planner.c    | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/backend/optimizer/path/uniquekeys.c b/src/backend/optimizer/path/uniquekeys.c
index b9567ca5c8..0e6c826fcd 100644
--- a/src/backend/optimizer/path/uniquekeys.c
+++ b/src/backend/optimizer/path/uniquekeys.c
@@ -1522,6 +1522,7 @@ add_combined_uniquekey(PlannerInfo *root,
 	return false;
 }
 
+/* FIXME comment */
 List*
 build_uniquekeys(PlannerInfo *root, List *sortclauses)
 {
@@ -1548,6 +1549,7 @@ build_uniquekeys(PlannerInfo *root, List *sortclauses)
 	return result;
 }
 
+/* FIXME comment */
 bool
 query_has_uniquekeys_for(PlannerInfo *root, List *pathuniquekeys,
 						 bool allow_multinulls)
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c
index 62c0e46c49..f66b9d4898 100644
--- a/src/backend/optimizer/plan/planner.c
+++ b/src/backend/optimizer/plan/planner.c
@@ -4857,11 +4857,13 @@ create_distinct_paths(PlannerInfo *root,
 			Path	   *path = (Path *) lfirst(lc);
 
 			if (pathkeys_contained_in(needed_pathkeys, path->pathkeys))
+			{
 				add_path(distinct_rel, (Path *)
 						 create_upper_unique_path(root, distinct_rel,
 												  path,
 												  list_length(root->distinct_pathkeys),
 												  numDistinctRows));
+			}
 		}
 
 		foreach(lc, input_rel->unique_pathlist)
-- 
2.30.2

--------------F495F6B18672582269F00FF9
Content-Type: text/x-patch; charset=UTF-8;
 name="0007-Index-skip-scan-20210317.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0007-Index-skip-scan-20210317.patch"