[postgis-users] GIST index speed

Kevin Neufeld kneufeld at refractions.net
Wed Jun 4 17:19:52 PDT 2008


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 at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>   



More information about the postgis-users mailing list