[postgis-users] Mapserv Issues

Zamil Murji Zamil.Murji at divestco.com
Mon May 17 08:30:14 PDT 2004


Hello list,

I've been having some weird problems with my mapserv install. These speed issues arise predominantly in NQUERY mode. Here is the situation:
1) I've created a spatial index on my geometry column
2) I've created an index on the oid column.
3) I've vacuum analyzed
4) I've run SELECT UPDATE_GEOMETRY_STATS();

After all of this, running the query at the psql command prompt gives excellent times (<0.5 seconds), but running it using mapserv takes ~5 seconds. I'm now convinced that this is not a database issue, but a bottleneck somewhere else. Maybe the connection is not getting setup right away but taking 2-3 seconds. Can anyone point me in the right direction? I'm having a tough time with this one. 

In the past doing the 4 steps above worked (speed issues would go away for a while but then everything would be back to slowness after a while). Now it seems that these 4 steps are doing nothing to help mapserv run faster.

I have also tried replacing my DATA statement with a simpler one:
DATA "the_geom from main_well1 using unique oid"
This does not seem to have an effect on the speed. Like I said before the query takes no time at all.

Here is my .map file
NAME TEST1

PROJECTION
 "proj=merc"
  "lat_ts=54.458353"
  "lon_0=-111.729445"
  "ellps=GRS80"
  "datum=NAD83"
END

LAYER
   NAME "wells"
#   DEBUG on
   TYPE point
   STATUS default
   MAXSCALE 1000000
   CONNECTIONTYPE postgis
   CONNECTION "user=idc dbname=idc host=idcmap port=5432"
   DATA "the_geom from (select oid, to_date(main_well1.spud_date, 'YYYY-MM-DD') as pretty_spud_date, to_date(main_well1.rig_rele\
ase_date, 'YYYY-MM-DD') as pretty_rig_release_date, * from main_well1) as new_table using unique oid"
   TEMPLATE "./idcdev_wells.html"
   PROJECTION
    "init=epsg:4269"
   END
END

END


Eternally grateful for you help.
Zamil



More information about the postgis-users mailing list