[postgis-users] GIST index speed

Markus Schaber schabi at logix-tt.com
Thu Jun 5 02:37:02 PDT 2008


Hi, Gregory,

"Gregory Williamson" <Gregory.Williamson at digitalglobe.com> wrote:

> ST_ functions are modern variants of older functions -- they include the bounding box check that eliminates most unwanted candidates from a search.
> 
> So try something like:
> 
> SELECT * FROM asdfs_track_point where the_geom && 'BOX3D(? ?, ? ?)'::box3d AND 
>  within(the_geom,GeometryFromText('POLYGON((-180.0 -90.0,-180.0
>  90.0,180.0 90.0,180.0 -90.0,-180.0 -90.0))',4326));


You can simply use the geometry there directly:

SELECT * FROM asdfs_track_point where the_geom &&
GeometryFromText('POLYGON((-180.0 -90.0,-180.0 90.0,180.0 90.0,180.0 -90.0,-180.0 -90.0))',4326) AND
within(the_geom,GeometryFromText('POLYGON((-180.0 -90.0,-180.0
90.0,180.0 90.0,180.0 -90.0,-180.0 -90.0))',4326));




Regards,
Markus

-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org



More information about the postgis-users mailing list