From 96a7f74ea50eac02248cb64e58ee3d672adf9a27 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Tue, 20 Nov 2012 20:57:48 +0000 Subject: [PATCH] Convert SearchSysCache calls to SearchSysCache# calls, per the guidance in the PostgreSQL syscache.h file git-svn-id: http://svn.osgeo.org/postgis/trunk@10721 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis/geography_estimate.c | 6 +++--- postgis/geometry_estimate.c | 12 +++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/postgis/geography_estimate.c b/postgis/geography_estimate.c index 50f30deb3..f97dad118 100644 --- a/postgis/geography_estimate.c +++ b/postgis/geography_estimate.c @@ -527,7 +527,7 @@ Datum geography_gist_selectivity(PG_FUNCTION_ARGS) */ relid = getrelid(self->varno, root->parse->rtable); - stats_tuple = SearchSysCache(STATRELATT, ObjectIdGetDatum(relid), Int16GetDatum(self->varattno), 0, 0); + stats_tuple = SearchSysCache2(STATRELATT, ObjectIdGetDatum(relid), Int16GetDatum(self->varattno)); if ( ! stats_tuple ) { POSTGIS_DEBUG(3, " No statistics, returning default estimate"); @@ -643,7 +643,7 @@ Datum geography_gist_join_selectivity(PG_FUNCTION_ARGS) POSTGIS_DEBUGF(3, "Working with relations oids: %d %d", relid1, relid2); /* Read the stats tuple from the first column */ - stats1_tuple = SearchSysCache(STATRELATT, ObjectIdGetDatum(relid1), Int16GetDatum(var1->varattno), 0, 0); + stats1_tuple = SearchSysCache2(STATRELATT, ObjectIdGetDatum(relid1), Int16GetDatum(var1->varattno)); if ( ! stats1_tuple ) { POSTGIS_DEBUG(3, " No statistics, returning default geometry join selectivity"); @@ -665,7 +665,7 @@ Datum geography_gist_join_selectivity(PG_FUNCTION_ARGS) /* Read the stats tuple from the second column */ - stats2_tuple = SearchSysCache(STATRELATT, ObjectIdGetDatum(relid2), Int16GetDatum(var2->varattno), 0, 0); + stats2_tuple = SearchSysCache2(STATRELATT, ObjectIdGetDatum(relid2), Int16GetDatum(var2->varattno)); if ( ! stats2_tuple ) { POSTGIS_DEBUG(3, " No statistics, returning default geometry join selectivity"); diff --git a/postgis/geometry_estimate.c b/postgis/geometry_estimate.c index d260ed80f..7da85d812 100644 --- a/postgis/geometry_estimate.c +++ b/postgis/geometry_estimate.c @@ -236,7 +236,7 @@ Datum geometry_gist_joinsel_2d(PG_FUNCTION_ARGS) POSTGIS_DEBUGF(3, "Working with relations oids: %d %d", relid1, relid2); /* Read the stats tuple from the first column */ - stats1_tuple = SearchSysCache(STATRELATT, ObjectIdGetDatum(relid1), Int16GetDatum(var1->varattno), 0, 0); + stats1_tuple = SearchSysCache2(STATRELATT, ObjectIdGetDatum(relid1), Int16GetDatum(var1->varattno)); if ( ! stats1_tuple ) { POSTGIS_DEBUG(3, " No statistics, returning default geometry join selectivity"); @@ -258,7 +258,7 @@ Datum geometry_gist_joinsel_2d(PG_FUNCTION_ARGS) /* Read the stats tuple from the second column */ - stats2_tuple = SearchSysCache(STATRELATT, ObjectIdGetDatum(relid2), Int16GetDatum(var2->varattno), 0, 0); + stats2_tuple = SearchSysCache2(STATRELATT, ObjectIdGetDatum(relid2), Int16GetDatum(var2->varattno)); if ( ! stats2_tuple ) { POSTGIS_DEBUG(3, " No statistics, returning default geometry join selectivity"); @@ -315,8 +315,7 @@ Datum geometry_gist_joinsel_2d(PG_FUNCTION_ARGS) * divided by the total number of tuples - hence we need to * multiply out the returned selectivity by the total number of rows. */ - class_tuple = SearchSysCache(RELOID, ObjectIdGetDatum(relid1), - 0, 0, 0); + class_tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relid1)); if (HeapTupleIsValid(class_tuple)) { @@ -327,8 +326,7 @@ Datum geometry_gist_joinsel_2d(PG_FUNCTION_ARGS) ReleaseSysCache(class_tuple); - class_tuple = SearchSysCache(RELOID, ObjectIdGetDatum(relid2), - 0, 0, 0); + class_tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relid2)); if (HeapTupleIsValid(class_tuple)) { @@ -765,7 +763,7 @@ Datum geometry_gist_sel_2d(PG_FUNCTION_ARGS) relid = getrelid(self->varno, root->parse->rtable); - stats_tuple = SearchSysCache(STATRELATT, ObjectIdGetDatum(relid), Int16GetDatum(self->varattno), 0, 0); + stats_tuple = SearchSysCache2(STATRELATT, ObjectIdGetDatum(relid), Int16GetDatum(self->varattno)); if ( ! stats_tuple ) { POSTGIS_DEBUG(3, " No statistics, returning default estimate"); -- 2.50.1