[mapserver-dev] WFS GetFeature Performance - BBOX vs. Filter

Smith, Michael ERDC-CRREL-NH Michael.Smith at usace.army.mil
Fri Oct 14 08:18:04 EDT 2011


I think this is a case where the actual filtering is being done.

In the BBOX case, MapServer is running the query against SDE and the
filtering is happening on the SDE side using the standard spatial
filtering that is used for all draw operations.

In the filter case, the MapServer is bringing back many records and doing
the filtering inside MapServer.

The WFS filters in MapServer are generally done within MapServer so as to
be done once for many different formats. However this does impose a huge
performance penalty by not moving the filtering logic into the driver
specific logic so the filtering happens on the backend.

If you turn on debugging (layer level debugging, level 5) you can see the
queries that MapServer is sending to the backend and see exactly what is
happening.

Mike

-- 
Michael Smith

US Army Corps
Remote Sensing GIS/Center



On 10/14/11 8:02 AM, "Jeff McKenna" <jmckenna at gatewaygeomatics.com> wrote:

>Not sure if this is related: I am noticing that for database queries
>with MS 6.0.1 through OGC (WMS/WFS) you must set "ows_extent" for each
>layer in your mapfile - this issue used to exist for just Oracle
>connections, but now I have seen it for SDE and Postgres as well.
>
>-jeff
>
>
>
>-- 
>Jeff McKenna
>MapServer Consulting and Training Services
>http://www.gatewaygeomatics.com/
>
>
>
>On 11-10-13 3:50 PM, myOpenLayersUName wrote:
>> Hello Mapserver-Dev folks,
>>
>> I'm hoping someone can comment on something I'm seeing that I can't
>> understand.
>>
>> I'm getting significantly different results in terms of performance
>>when I
>> make what is essentially the same WFS GetFeature request with two
>>different
>> parameters to define the area to use for the query. The differences are
>> quite spectacular. If I use a Bbox parameter, I get an answer back in
>> seconds. If I use a Filter parameter, it takes minutes (the layer has
>>around
>> 1 million records and I'm accessing it through SDE). The responses for
>>each
>> are correct (2 features' coordinates and attributes); it's just the
>>times to
>> complete the query that are so different. I've also tried this on a
>> Shapefile with a million records and it takes 1-2 seconds to get a
>>response
>> using a BBOX and over a minute using the filter.
>>
>> We'd prefer to use the Filter parameter because our application is
>>supposed
>> to support the use of more complex polygons as well as bounding boxes,
>>but
>> these differences are pretty significant and may require that we
>>re-think
>> support for WFS GetFeature requests with more complex polygons.
>>
>> I am working with MapServer 6.0.1 that includes Changeset 12031 (to
>>allow me
>> to query through SDE without seg-faulting) and 4011.patch (to allow me
>>to
>> use the maxFeatures parameter).
>>
>> Any info regarding why these times are so different and what, if
>>anything, I
>> can do to reduce them (perhaps my filter definition is atypical
>>somehow?)
>> would be greatly appreciated.
>>
>> Cheers,
>> jtm
>>
>>
>> /mapserv/httpd/cgi-bin/mapserv -nh
>> 
>>"QUERY_STRING=map=/data/nl18/httpd/apps/myApp/map/myMap.map&service=wfs&v
>>ersion=1.0.0&request=getfeature&typename=myLayer&srsName=EPSG:26914&filte
>>r=%3Cogc%3AFilter%20xmlns%3Aogc%3D%22http%3A%2F%2Fwww.opengis.net%2Fogc%2
>>2%3E%3Cogc%3ABBOX%3E%3Cogc%3APropertyName%3EmsGeometry%3C%2Fogc%3APropert
>>yName%3E%3Cgml%3AEnvelope%20xmlns%3Agml%3D%22http%3A%2F%2Fwww.opengis.net
>>%2Fgml%22%20srsName%3D%22EPSG%3A26914%22%3E%3Cgml%3AlowerCorner%3E435309.
>>38597013%205522753.8537993%3C%2Fgml%3AlowerCorner%3E%3Cgml%3AupperCorner%
>>3E437373.1348557%205523970.9364754%3C%2Fgml%3AupperCorner%3E%3C%2Fgml%3AE
>>nvelope%3E%3C%2Fogc%3ABBOX%3E%3C%2Fogc%3AFilter%3E&maxFeatures=10"
>>
>> - and -
>>
>> /mapserv/httpd/cgi-bin/mapserv -nh
>> 
>>"QUERY_STRING=map=/data/nl18/httpd/apps/myApp/map/myMap.map&service=wfs&v
>>ersion=1.0.0&request=getfeature&typename=myLayer&bbox=435309.38597013,552
>>2753.8537993,437373.1348557,5523970.9364754&maxFeatures=10"
>>
>>
>>
>_______________________________________________
>mapserver-dev mailing list
>mapserver-dev at lists.osgeo.org
>http://lists.osgeo.org/mailman/listinfo/mapserver-dev



More information about the mapserver-dev mailing list