Postgis Gist Index

Paul Ramsey pramsey at REFRACTIONS.NET
Tue Apr 18 16:26:46 EDT 2006


Your data statement is needlessly complicated, which is creating more  
convoluted SQL than you need at the backend, but generally the  
planner optimizes these things away.  You could try

> layer->set("data","the_geom FROM south_america_large USING UNIQUE  
> gid USING SRID=-1");

I doubt it will help much. Check your postgresql statement log (you  
will have to turn on statement loggin) and plug the query into psql  
to see what the SQL EXPLAIN shows.

P

On 18-Apr-06, at 9:42 AM, Bertsch wrote:

> Hi List,
>
> As I was reading in the PostGIS manual a GIST index on the geometry  
> column
> will speed up the application in several cases.
> So i was creating an index on my south_america_large table with  
> CREATE INDEX
> south_america_large_index ON south_america_large USING GIST(the_geom
> GIST_GEOMETRY_OPS); VACUUM ANALYZE;
> Code:
> layer->set("data","the_geom FROM (SELECT the_geom,gid FROM
> south_america_large) AS myquery USING UNIQUE GID USING SRID=-1");
> map->setExtent(-54,-20,-39,-9); the extension of this map is  
> (-117,-56) -
> (-34,32)
>
> When i run the application i get the same time using the database  
> with GIST
> or using it without GIST. Furthermore i was trying the same with a  
> shape
> file and a quadtree index and i got better results for the  
> shapefile with
> the quadtree index. Maybe someone can help me.
> Thanks,
> Clemens
> --
> View this message in context: http://www.nabble.com/Postgis-Gist- 
> Index-t1469264.html#a3971891
> Sent from the Mapserver - User forum at Nabble.com.



More information about the mapserver-users mailing list