Optimizing PostGIS.

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Wed Apr 12 08:43:16 EDT 2006


Hi Luca,

As Bart has already mentioned shapefiles are generally faster, but there 
is no heed to put everything in PostGIS for rendering. You may have 
other requirements to do so. You can put your point layer in PostGIS and 
keep you other data in shapefile and get the best of both worlds. Keep 
the voliatile data in PostGIS and the static data in shapefiles.

If it is all voilatile data then some performance is the cost of getting 
the PostGIS features.

-Steve

Luca Manganelli wrote:
> Hi,
> 
> I'm trying to optimizie a postgis table.
> 
> I did "shp2pgsql" command to convert a large shapefile (17 MB, over
> 5000 features) then I imported it into postgres 8.1.
> I created spatial index and I did VACUUM ANALYZE on that table.
> I followed the steps in "Performance tips" on Postgis Documentation at
> http://postgis.refractions.net/docs/ch05.html (expecially in 5.2 and
> 5.3).
> 
> BUT, in my mapserver the shapefile drawn at max extent is somewhat
> 50%-100% faster
> than Postgis. That performance gain reduces to a 10%-30% in lower scales.
> If I do a point query on Postgis table, it is not much faster (but the
> performances are often equals!!)...
> 
> Any idea?
> 
> --
> "Work only as many hours as you can be productive and only as many hours as
>  you can sustain."  - Kent Beck, in "Extreme Programming Explained"
> 
> http://www.trapanator.com/blog
> 



More information about the mapserver-users mailing list