[Mapserver-users] postgres query speed problems

Grant Howarth Grant.Howarth at divestco.com
Thu Dec 11 10:20:03 PST 2003


I am using a postgres database to mapdata.  The mapping works without any problems and has good speed.  When i swich to mode=nquery and try and query for the results of an area it takes over a minute to respond.  I don't understand why there such a speed problem when querying.

my cgi call:
----------------

http://207.34.103.9/cgi-bin/mapserv?mode=nquery&map=/mapfiles/idc_canada-query.map&imgext=-114.39043+55.92687+-114.03728+56.12285&mapsize=373+207&imgbox=203+47+214+57&layers=wells


my idc_canada-query.map file:
---------------------------------------------

NAME test

LAYER
  NAME "wells"
  TYPE point
  STATUS off
  MAXSCALE 8
  CONNECTIONTYPE postgis
  CONNECTION "user=myuser dbname=idc host=idcmap port=5432"
  DATA "the_geom from gen_well"
  TEMPLATE "./test.html"
END


my test.html file:
------------------------

{item: wells [uwi] }



when ran, i do get the following results but it takes about a minute for it to come back:
{item: wells 100020208202W502 } {item: wells 100020208202W500 } 


my table does have geometry columns
there is an index on the uwi (primary key)
there is an index on oid
there is an index on the_geom


I managed to capture the query that i think mapserv is running and ran it myself and it responded in less than a second. So it seems like mapserv is doing something after with the data that is taking along time?

Any sugestions would be greatly appreciated.

Thanks, Grant





More information about the MapServer-users mailing list