summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/plan
diff options
context:
space:
mode:
authorRichard Guo <rguo@postgresql.org>2025-08-19 09:37:04 +0900
committerRichard Guo <rguo@postgresql.org>2025-08-19 09:37:04 +0900
commitbf9ee294e567654231c5b2fef09b8a5367907366 (patch)
treecd402bb897bc06159a16146b80d58364cf461cdf /src/backend/optimizer/plan
parent24225ad9aafc576295e210026d8ffa9f50d61145 (diff)
Simplify relation_has_unique_index_for()
Now that the only call to relation_has_unique_index_for() that supplied an exprlist and oprlist has been removed, the loop handling those lists is effectively dead code. This patch removes that loop and simplifies the function accordingly. Author: Richard Guo <guofenglinux@gmail.com> Discussion: https://postgr.es/m/CAMbWs4-EBnaRvEs7frTLbsXiweSTUXifsteF-d3rvv01FKO86w@mail.gmail.com
Diffstat (limited to 'src/backend/optimizer/plan')
-rw-r--r--src/backend/optimizer/plan/analyzejoins.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backend/optimizer/plan/analyzejoins.c b/src/backend/optimizer/plan/analyzejoins.c
index 4d55c2ea591..da92d8ee414 100644
--- a/src/backend/optimizer/plan/analyzejoins.c
+++ b/src/backend/optimizer/plan/analyzejoins.c
@@ -990,11 +990,10 @@ rel_is_distinct_for(PlannerInfo *root, RelOptInfo *rel, List *clause_list,
{
/*
* Examine the indexes to see if we have a matching unique index.
- * relation_has_unique_index_ext automatically adds any usable
+ * relation_has_unique_index_for automatically adds any usable
* restriction clauses for the rel, so we needn't do that here.
*/
- if (relation_has_unique_index_ext(root, rel, clause_list, NIL, NIL,
- extra_clauses))
+ if (relation_has_unique_index_for(root, rel, clause_list, extra_clauses))
return true;
}
else if (rel->rtekind == RTE_SUBQUERY)