From b6d8a8ac9216c5e8a23b45920ecb95473dec13b1 Mon Sep 17 00:00:00 2001 From: Tomas Vondra Date: Mon, 17 Jun 2024 15:43:17 +0200 Subject: [PATCH v20240617 18/56] review --- src/backend/statistics/mcv.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/backend/statistics/mcv.c b/src/backend/statistics/mcv.c index 8b09bf16662..f3b607d583b 100644 --- a/src/backend/statistics/mcv.c +++ b/src/backend/statistics/mcv.c @@ -2307,6 +2307,15 @@ mcv_combine_extended(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2, foreach (lc, clauses) { + /* + * XXX Can we just assume the clause has a RestrictInfo on top? IIRC + * there are cases where we can get here without it (e.g. AND + * clause?). + * + * XXX Not sure if we need to care about removing other node types too + * (e.g. RelabelType etc.). statext_is_supported_join_clause matches + * this, but maybe we need to relax it? + */ RestrictInfo *rinfo = (RestrictInfo *) lfirst(lc); Node *clause = (Node *) rinfo->clause; OpExpr *opexpr; -- 2.45.2