Are you using within() or ST_Within()? The latter automatically uses the gist index, the former does not.

-- Kevin

Peck, Brian wrote:

Hey all,

I currently am working on a PostGIS database (Postgres 8.3) and the requests are going slower than expected.

The table I’m querying off of has ~42000 entries in it, and the geometry field I’m using has a gist index on it. The query however is taking ~6 seconds to return me the entries.

I am making the query

SELECT * FROM asdfs_track_point where 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));

This is a test case and so I am doing the entire world to find out how long things should take, but I’m told that with only 42000 rows in the table it should be faster than 6 seconds.

Anyone have any idea why it might be going slow, or a way to speed up the query?

Thanks,

- Brian Peck

- 858-795-1398

- Software Engineer

- Lockheed Martin

------------------------------------------------------------------------

_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to