From 8c8273ed818a533cdb866a5a5aa49dfdcc73794d Mon Sep 17 00:00:00 2001 From: Tomas Vondra Date: Mon, 17 Jun 2024 15:53:09 +0200 Subject: [PATCH v20240617 21/56] review --- src/backend/statistics/extended_stats.c | 6 ++++++ src/backend/statistics/mcv.c | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c index 241c7d4ec35..82c65e38fba 100644 --- a/src/backend/statistics/extended_stats.c +++ b/src/backend/statistics/extended_stats.c @@ -2745,6 +2745,8 @@ statext_find_matching_mcv(PlannerInfo *root, RelOptInfo *rel, * XXX Or maybe we should simply "count" the restrictions here, * instead of constructing a list? Probably not a meaningful * difference in CPU costs or a memory leak. + * + * XXX Why are we recalculating conditions1 here? */ conditions1 = statext_determine_join_restrictions(root, rel, stat); conditions2 = statext_determine_join_restrictions(root, rel, mcv); @@ -3123,6 +3125,10 @@ statext_build_join_pairs(PlannerInfo *root, List *clauses, * XXX Name should probably start with statext_ too. * * XXX The 0/1 index seems a bit weird. Is there a better way to do this? + * + * XXX I somehow dislike the finctions returning a lot of stuff using output + * arguments / pointers. Maybe it's time to invent a new struct returned by + * this function? */ static RelOptInfo * extract_relation_info(PlannerInfo *root, JoinPairInfo *info, int index, diff --git a/src/backend/statistics/mcv.c b/src/backend/statistics/mcv.c index 68a2cff1611..88d2f7ee233 100644 --- a/src/backend/statistics/mcv.c +++ b/src/backend/statistics/mcv.c @@ -2208,8 +2208,7 @@ mcv_clause_selectivity_or(PlannerInfo *root, StatisticExtInfo *stat, Selectivity mcv_combine_extended(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2, StatisticExtInfo *stat1, StatisticExtInfo *stat2, - List *base_cond1, List *base_cond2, - List *clauses) + List *base_cond1, List *base_cond2, List *clauses) { ListCell *lc; -- 2.45.2