]> granicus.if.org Git - postgis/commitdiff
RESTRICT selectivity estimator use self->varno instead of varRelid.
authorSandro Santilli <strk@keybit.net>
Tue, 8 Mar 2005 09:27:23 +0000 (09:27 +0000)
committerSandro Santilli <strk@keybit.net>
Tue, 8 Mar 2005 09:27:23 +0000 (09:27 +0000)
Seems to work for subqueries...

git-svn-id: http://svn.osgeo.org/postgis/trunk@1509 b70326c6-7e19-0410-871a-916f4a2858ee

lwgeom/lwgeom_estimate.c

index badbd24ab5f80e93776c919de4cd330a7b1b8ea8..57eba1d279a4c337d86adb0469b2510047036a29 100644 (file)
@@ -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.
  *