From bf9f8c192e1b0129c7f96f8f435e40d44e0a1b85 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Tue, 8 Mar 2005 09:27:23 +0000 Subject: [PATCH] RESTRICT selectivity estimator use self->varno instead of varRelid. Seems to work for subqueries... git-svn-id: http://svn.osgeo.org/postgis/trunk@1509 b70326c6-7e19-0410-871a-916f4a2858ee --- lwgeom/lwgeom_estimate.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lwgeom/lwgeom_estimate.c b/lwgeom/lwgeom_estimate.c index badbd24ab..57eba1d27 100644 --- a/lwgeom/lwgeom_estimate.c +++ b/lwgeom/lwgeom_estimate.c @@ -1570,7 +1570,7 @@ Datum LWGEOM_gist_sel(PG_FUNCTION_ARGS) Query *root = (Query *) PG_GETARG_POINTER(0); //Oid operator = PG_GETARG_OID(1); List *args = (List *) PG_GETARG_POINTER(2); - int varRelid = PG_GETARG_INT32(3); + //int varRelid = PG_GETARG_INT32(3); Oid relid; HeapTuple stats_tuple; GEOM_STATS *geomstats; @@ -1652,7 +1652,8 @@ Datum LWGEOM_gist_sel(PG_FUNCTION_ARGS) * Get pg_statistic row */ - relid = getrelid(varRelid, root->rtable); +// relid = getrelid(varRelid, root->rtable); + relid = getrelid(self->varno, root->rtable); stats_tuple = SearchSysCache(STATRELATT, ObjectIdGetDatum(relid), Int16GetDatum(self->varattno), 0, 0); if ( ! stats_tuple ) @@ -2446,6 +2447,10 @@ Datum LWGEOM_estimated_extent(PG_FUNCTION_ARGS) /********************************************************************** * $Log$ + * Revision 1.26 2005/03/08 09:27:23 strk + * RESTRICT selectivity estimator use self->varno instead of varRelid. + * Seems to work for subqueries... + * * Revision 1.25 2005/03/08 09:23:34 strk * Fixed debugging lines. * -- 2.40.0