[postgis-commits] svn - r3514 - trunk/lwgeom

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Sat Jan 10 23:10:07 PST 2009


Author: pramsey
Date: 2009-01-10 23:10:06 -0800 (Sat, 10 Jan 2009)
New Revision: 3514

Modified:
   trunk/lwgeom/lwgeom_gist.c
   trunk/lwgeom/lwpostgis.sql.in.c
Log:
Remove RECHECK per GBT#18.


Modified: trunk/lwgeom/lwgeom_gist.c
===================================================================
--- trunk/lwgeom/lwgeom_gist.c	2009-01-09 23:04:47 UTC (rev 3513)
+++ trunk/lwgeom/lwgeom_gist.c	2009-01-11 07:10:06 UTC (rev 3514)
@@ -556,9 +556,10 @@
 	   rather than being supplied as part of the operator class definition */
 	bool *recheck = (bool *) PG_GETARG_POINTER(4);
 
-	/* Since the index is lossy from conversion from float8 to float4, we must
-	   recheck */
-	*recheck = true;
+	/* We set recheck to false to avoid repeatedly pulling every "possibly matched" geometry
+	   out during index scans. For cases when the geometries are large, doing this
+	   can make things twice as slow. */
+	*recheck = false;
 #endif
 
 	POSTGIS_DEBUG(2, "GIST: LWGEOM_gist_consistent called");

Modified: trunk/lwgeom/lwpostgis.sql.in.c
===================================================================
--- trunk/lwgeom/lwpostgis.sql.in.c	2009-01-09 23:04:47 UTC (rev 3513)
+++ trunk/lwgeom/lwpostgis.sql.in.c	2009-01-11 07:10:06 UTC (rev 3514)
@@ -990,28 +990,25 @@
 -------------------------------------------
 -- GIST opclass index binding entries.
 -------------------------------------------
-
-#if POSTGIS_PGSQL_VERSION < 84
-
 --
--- Create opclass index bindings for PG>=73 and PG<=83
+-- Create opclass index bindings for PG>=73
 --
 
 CREATE OPERATOR CLASS gist_geometry_ops
         DEFAULT FOR TYPE geometry USING gist AS
 	STORAGE 	box2d,
-        OPERATOR        1        << 	RECHECK,
-        OPERATOR        2        &<	RECHECK,
-        OPERATOR        3        &&	RECHECK,
-        OPERATOR        4        &>	RECHECK,
-        OPERATOR        5        >>	RECHECK,
-        OPERATOR        6        ~=	RECHECK,
-        OPERATOR        7        ~	RECHECK,
-        OPERATOR        8        @	RECHECK,
-	OPERATOR	9	 &<|	RECHECK,
-	OPERATOR	10	 <<|	RECHECK,
-	OPERATOR	11	 |>>	RECHECK,
-	OPERATOR	12	 |&>	RECHECK,
+        OPERATOR        1        << 	,
+        OPERATOR        2        &<	,
+        OPERATOR        3        &&	,
+        OPERATOR        4        &>	,
+        OPERATOR        5        >>	,
+        OPERATOR        6        ~=	,
+        OPERATOR        7        ~	,
+        OPERATOR        8        @	,
+	OPERATOR	9	 &<|	,
+	OPERATOR	10	 <<|	,
+	OPERATOR	11	 |>>	,
+	OPERATOR	12	 |&>	,
 	FUNCTION        1        LWGEOM_gist_consistent (internal, geometry, int4),
         FUNCTION        2        LWGEOM_gist_union (bytea, internal),
         FUNCTION        3        LWGEOM_gist_compress (internal),
@@ -1019,39 +1016,6 @@
         FUNCTION        5        LWGEOM_gist_penalty (internal, internal, internal),
         FUNCTION        6        LWGEOM_gist_picksplit (internal, internal),
         FUNCTION        7        LWGEOM_gist_same (box2d, box2d, internal);
-
-#else
-
---
--- Create opclass index bindings for PG>83 
--- (No RECHECK since this is now handled as part of the GiST Access methods)
---
-
-CREATE OPERATOR CLASS gist_geometry_ops
-        DEFAULT FOR TYPE geometry USING gist AS
-	STORAGE 	box2d,
-        OPERATOR        1        <<,
-        OPERATOR        2        &<,
-        OPERATOR        3        &&,
-        OPERATOR        4        &>,
-        OPERATOR        5        >>,
-        OPERATOR        6        ~=,
-        OPERATOR        7        ~,
-        OPERATOR        8        @,
-	OPERATOR	9	 &<|,
-	OPERATOR	10	 <<|,
-	OPERATOR	11	 |>>,
-	OPERATOR	12	 |&>,
-	FUNCTION        1        LWGEOM_gist_consistent (internal, geometry, int4),
-        FUNCTION        2        LWGEOM_gist_union (bytea, internal),
-        FUNCTION        3        LWGEOM_gist_compress (internal),
-        FUNCTION        4        LWGEOM_gist_decompress (internal),
-        FUNCTION        5        LWGEOM_gist_penalty (internal, internal, internal),
-        FUNCTION        6        LWGEOM_gist_picksplit (internal, internal),
-        FUNCTION        7        LWGEOM_gist_same (box2d, box2d, internal);
-
-#endif
-
 	
 -------------------------------------------
 -- other lwgeom functions



More information about the postgis-commits mailing list