[mapserver-users] querying WMS layer / WFS reprise

Paul Spencer spencer at dmsolutions.ca
Thu Jun 3 11:52:58 PDT 2004


create btree indexes on your oid field and create GIST indexes as 
suggested in the postgis documentation.

eg:

btree index (assuming oid is the object id field):

CREATE INDEX mytable_oid_idx ON mytable (oid);

GIST index (assuming wkb_geometry is your geometry column):

CREATE INDEX mytable_gist ON mytable USING GIST ( wkb_geometry 
GIST_GEOMETRY_OPS );

And run VACUUM ANALYZE; after any changes to indexing to optimize the 
query planner.

Cheers,

Paul

Daniel Morissette wrote:

> Gregor Mosheh wrote:
> 
>>
>> The queries were being done directly to the WFS server (telnet localhost
>> 80), too, not via a MapServer WFS client. It wasn't a matter of the data
>> taking a while to transfer: there was simply no activity for several
>> minutes, and then the data came across. It was definitely something
>> "inside" the WFS server, as opposed to the rendering or transit of the
>> data.
>>
>> The result sets weren't very large: 20 or less multipolygons (zipcode
>> areas). A fair chunk of data, but it's over a LAN. The same query via WMS
>> responded in 1-2 seconds, indicating that it's the WFS stuff, as opposed
>> to the underlying data, that's taking the time.
>>
> 
> I think you are using PostGIS as your data layers, is that correct?
> 
> MapServer's uses internal queries for GetFeature WFS requests, and a 
> performance problem with MapServer queries on large PostGIS layers has 
> been discussed on this list and on the chameleon lists in the last few 
> days.
> 
> It turned out that adding some indexes improved the query performance a 
> lot. I don't know the details, hopefully others can comment or you can 
> find them in the archives.
> 

-- 
  -----------------------------------------------------------------
|Paul Spencer                           pspencer at dmsolutions.ca   |
|-----------------------------------------------------------------|
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
  -----------------------------------------------------------------




More information about the MapServer-users mailing list