Skip to content

Commit

Permalink
Change syscache stats lookup to use STATRELATTINH key and three param…
Browse files Browse the repository at this point in the history
…eters in all cases. References #3904

git-svn-id: http://svn.osgeo.org/postgis/trunk@16175 b70326c6-7e19-0410-871a-916f4a2858ee
  • Loading branch information
pramsey committed Dec 20, 2017
1 parent f1f6de4 commit 1dcde30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions postgis/gserialized_estimate.c
Original file line number Diff line number Diff line change
Expand Up @@ -935,15 +935,15 @@ 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");
}
/* Fall-back to main table stats only, if not found for whole tree or explicitly ignored */
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");
}
Expand Down

0 comments on commit 1dcde30

Please sign in to comment.