From 1dcde30cb72b96c866d76c56178a3427c223394f Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Wed, 20 Dec 2017 22:57:42 +0000 Subject: [PATCH] Change syscache stats lookup to use STATRELATTINH key and three parameters in all cases. References #3904 git-svn-id: http://svn.osgeo.org/postgis/trunk@16175 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis/gserialized_estimate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/postgis/gserialized_estimate.c b/postgis/gserialized_estimate.c index ad9a42ac1..8fa9f612b 100644 --- a/postgis/gserialized_estimate.c +++ b/postgis/gserialized_estimate.c @@ -935,7 +935,7 @@ pg_get_nd_stats(const Oid table_oid, AttrNumber att_num, int mode, bool only_par if ( ! only_parent ) { POSTGIS_DEBUGF(2, "searching whole tree stats for \"%s\"", get_rel_name(table_oid)? get_rel_name(table_oid) : "NULL"); - stats_tuple = SearchSysCache3(STATRELATT, table_oid, att_num, true); + stats_tuple = SearchSysCache3(STATRELATTINH, ObjectIdGetDatum(table_oid), Int16GetDatum(att_num), BoolGetDatum(true)); if ( stats_tuple ) POSTGIS_DEBUGF(2, "found whole tree stats for \"%s\"", get_rel_name(table_oid)? get_rel_name(table_oid) : "NULL"); } @@ -943,7 +943,7 @@ pg_get_nd_stats(const Oid table_oid, AttrNumber att_num, int mode, bool only_par if ( only_parent || ! stats_tuple ) { POSTGIS_DEBUGF(2, "searching parent table stats for \"%s\"", get_rel_name(table_oid)? get_rel_name(table_oid) : "NULL"); - stats_tuple = SearchSysCache2(STATRELATT, table_oid, att_num); + stats_tuple = SearchSysCache3(STATRELATTINH, ObjectIdGetDatum(table_oid), Int16GetDatum(att_num), BoolGetDatum(false)); if ( stats_tuple ) POSTGIS_DEBUGF(2, "found parent table stats for \"%s\"", get_rel_name(table_oid)? get_rel_name(table_oid) : "NULL"); } -- 2.40.0