Hi Ian!
Thanks for you answer!
I understand that parsing 20KB takes some time.
But why does in slow down exponentically (see digram in
https://gis.stackexchange.com/a/82305 )?
I might be able to change the filter - but in fact this is a "simplification"
for needing only the ID in the GeoServer layer (and not all attributes the
filter relys on initially).
I also had a look at the source code of GeoTools (guess
https://github.com/geotools/geotools/blob/master/modules/library/main/src/main/java/org/geotools/filter/visitor/SimplifyingFilterVisitor.java
is right), but I don't understand it completely.
Most of all I don't understand why GeoTools needs to parse a IN statement (and
translates it to multiple ORs).
The only reason I can think of is to disable SQL injections.
But again it should not slow down the request time exponentially.
And interestingly if I don't use CQL_FILTER=id IN (1,2,…) but
&FEATUREID=fid1,fid2,… GeoServer scales much better!
Conclusion: I might find an easier way for my filter.
But a exponential speed reduction seems like a bug to me.
As a workaround I will try to use FEATUREID instead of CQL_FILTER!
Here is a publically available example (I must admit I don't know if the
Medford data is stored on a database):
2 Buildings:
https://demo.boundlessgeo.com/geoserver/medford/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=medford:buildings&CQL_FILTER=key%20IN%20(18086%2C%2018087)
takes 360ms
https://demo.boundlessgeo.com/geoserver/medford/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=medford:buildings&FEATUREID=buildings.18086,buildings.18087
takes 460ms
20 Buildings
https://demo.boundlessgeo.com/geoserver/medford/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=medford:buildings&CQL_FILTER=key%20IN%20(1%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C10%2C11%2C12%2C13%2C14%2C15%2C16%2C17%2C18%2C19%2C20)
takes approx. 800ms with CQL_FILTER
and takes 480ms with FEATUREID (2+ time, first is ~700ms)
40 Buildings
takes 1270ms with CQL_FILTER
and 480ms with FEATUREID
230 Buildings:
takes approx. 8000ms with CQL_FILTER
Of course you need to use POST for more IDs…
where as
https://demo.boundlessgeo.com/geoserver/medford/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=medford:buildings&maxFeatures=230
takes only 250ms
Best regards,
Bernhard
Von: Ian Turton [mailto:ijtur...@gmail.com]
Gesendet: Donnerstag, 01. März 2018 16:14
An: Bernhard Kiselka
Cc:
geoserver-users@lists.sourceforge.net<mailto:geoserver-users@lists.sourceforge.net>
Betreff: Re: [Geoserver-users] GeoServer slowing down with bigger CQL filters
Parsing a CQL filter of that size is bound to take a while and then it has to
be translated into an SQL statement which will also take a while.
I suspect there must be an easier way of doing what ever you are doing with out
the need for a 20Kb filter.
Ian
On 1 March 2018 at 13:14, Bernhard Kiselka
<bernhard.kise...@prisma-solutions.at<mailto:bernhard.kise...@prisma-solutions.at>>
wrote:
Hi list!
I did not do so much research as in https://gis.stackexchange.com/a/82305 but
as my data increased, my CQL_FILTER containing IDs that shall be rendered
increased from 600 to 1800 (20 kilobyte of filter string!) and GeoServer
response time increased from 1 second to 5 seconds.
Does someone has any guesses why GeoServer is slowing down exponentially?
I assume that parsing the filter is slow, because the postgres database query
is _not_ slowing down that much (the query itself takes less than 100ms).
Thanks for any thoughts!
Best regards,
Bernhard
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before posting to this
list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
If you want to request a feature or an improvement, also see this:
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
Geoserver-users@lists.sourceforge.net<mailto:Geoserver-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
Ian Turton
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before posting to this
list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
If you want to request a feature or an improvement, also see this:
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users