This is an automated email from the ASF dual-hosted git repository.
chenjinbao1989 pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/cbdb-postgres-merge by this
push:
new 6dcd2844229 Fix conflict for statistics
6dcd2844229 is described below
commit 6dcd2844229aea448b86b1382bfd1344336731ff
Author: Jinbao Chen <[email protected]>
AuthorDate: Fri Jul 18 16:11:55 2025 +0800
Fix conflict for statistics
---
src/backend/gpopt/gpdbwrappers.cpp | 2 +-
src/backend/statistics/dependencies.c | 16 ++--------------
src/backend/statistics/extended_stats.c | 13 -------------
src/include/statistics/statistics.h | 2 +-
4 files changed, 4 insertions(+), 29 deletions(-)
diff --git a/src/backend/gpopt/gpdbwrappers.cpp
b/src/backend/gpopt/gpdbwrappers.cpp
index ae17549da77..bf1f6cd9d0b 100644
--- a/src/backend/gpopt/gpdbwrappers.cpp
+++ b/src/backend/gpopt/gpdbwrappers.cpp
@@ -1970,7 +1970,7 @@ gpdb::GetMVDependencies(Oid stat_oid)
{
GP_WRAP_START;
{
- return statext_dependencies_load(stat_oid, true);
+ return statext_dependencies_load(stat_oid, false, true);
}
GP_WRAP_END;
}
diff --git a/src/backend/statistics/dependencies.c
b/src/backend/statistics/dependencies.c
index 41c292433c7..b3f77b19270 100644
--- a/src/backend/statistics/dependencies.c
+++ b/src/backend/statistics/dependencies.c
@@ -354,11 +354,7 @@ statext_dependencies_build(StatsBuildData *data)
/* result */
MVDependencies *dependencies = NULL;
-<<<<<<< HEAD
- MemoryContext cxt;
-=======
MemoryContext cxt;
->>>>>>> REL_16_9
Assert(data->nattnums >= 2);
@@ -622,11 +618,7 @@ dependency_is_fully_matched(MVDependency *dependency,
Bitmapset *attnums)
* Load the functional dependencies for the indicated
pg_statistic_ext tuple
*/
MVDependencies *
-<<<<<<< HEAD
-statext_dependencies_load(Oid mvoid, bool allow_null)
-=======
-statext_dependencies_load(Oid mvoid, bool inh)
->>>>>>> REL_16_9
+statext_dependencies_load(Oid mvoid, bool inh, bool allow_null)
{
MVDependencies *result;
bool isnull;
@@ -1654,11 +1646,7 @@ dependencies_clauselist_selectivity(PlannerInfo *root,
if (nmatched + nexprs < 2)
continue;
-<<<<<<< HEAD
- deps = statext_dependencies_load(stat->statOid, false);
-=======
- deps = statext_dependencies_load(stat->statOid, rte->inh);
->>>>>>> REL_16_9
+ deps = statext_dependencies_load(stat->statOid, rte->inh,
false);
/*
* The expressions may be represented by different attnums in
the
diff --git a/src/backend/statistics/extended_stats.c
b/src/backend/statistics/extended_stats.c
index ce046b627e5..a022d091579 100644
--- a/src/backend/statistics/extended_stats.c
+++ b/src/backend/statistics/extended_stats.c
@@ -1750,19 +1750,6 @@ statext_mcv_clauselist_selectivity(PlannerInfo *root,
List *clauses, int varReli
int listidx;
Selectivity sel = (is_or) ? 0.0 : 1.0;
RangeTblEntry *rte = planner_rt_fetch(rel->relid, root);
-<<<<<<< HEAD
-
- /*
- * When dealing with regular inheritance trees, ignore extended stats
- * (which were built without data from child rels, and thus do not
- * represent them). For partitioned tables data there's no data in the
- * non-leaf relations, so we build stats only for the inheritance tree.
- * So for partitioned tables we do consider extended stats.
- */
- if (rte->inh && rte->relkind != RELKIND_PARTITIONED_TABLE)
- return sel;
-=======
->>>>>>> REL_16_9
/* check if there's any stats that might be useful for us. */
if (!has_stats_of_kind(rel->statlist, STATS_EXT_MCV))
diff --git a/src/include/statistics/statistics.h
b/src/include/statistics/statistics.h
index b84509834eb..56c7390e6e9 100644
--- a/src/include/statistics/statistics.h
+++ b/src/include/statistics/statistics.h
@@ -96,7 +96,7 @@ typedef struct MCVList
extern MVNDistinct *statext_ndistinct_load(Oid mvoid, bool inh);
-extern MVDependencies *statext_dependencies_load(Oid mvoid, bool inh);
+extern MVDependencies *statext_dependencies_load(Oid mvoid, bool inh, bool
allow_null);
extern MCVList *statext_mcv_load(Oid mvoid, bool inh);
extern void BuildRelationExtStatistics(Relation onerel, bool inh, double
totalrows,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]