[postgis-tickets] r16176 - Change syscache stats lookup to use STATRELATTINH key and three parameters in all cases for 2.4 branch. Closes #3904

Paul Ramsey pramsey at cleverelephant.ca
Wed Dec 20 03:09:33 PST 2017


Author: pramsey
Date: 2017-12-20 15:09:33 -0800 (Wed, 20 Dec 2017)
New Revision: 16176

Modified:
   branches/2.4/postgis/gserialized_estimate.c
Log:
Change syscache stats lookup to use STATRELATTINH key and three parameters in all cases for 2.4 branch. Closes #3904


Modified: branches/2.4/postgis/gserialized_estimate.c
===================================================================
--- branches/2.4/postgis/gserialized_estimate.c	2017-12-20 22:57:42 UTC (rev 16175)
+++ branches/2.4/postgis/gserialized_estimate.c	2017-12-20 23:09:33 UTC (rev 16176)
@@ -889,7 +889,7 @@
 	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");
 	}
@@ -897,7 +897,7 @@
 	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");
 	}



More information about the postgis-tickets mailing list