[GIS] CQL Filter in Geoserver very slow

cql-filtergeoserveroptimization

I am experimenting with CQL filtering in Geoserver. I have two layers, one (A) has 8000 features, the other one (B) has 3000 features or so.
I would like to search of layer A for intersection with layer B's features. Not all of Layer B's features, just a few based on their feature ID.

I've been searching around and I can't find a way yet to do the feature ID + geometry filter, I hope someone can suggest me how to do that.

So in the meantime, I have tried with another attribute I've put in, though, and the CQL Filter is currently like this with WMS:

layers=A
CQL_FILTER=INTERSECTS(the_geom,querySingle('B','the_geom','OBJECTID=6139'))

When I run this in my browser , the query goes forever and timed out. There is an error in the jetty : org.geoserver.platform.ServiceException: This requested used more time than allowed and has been forcefully stopped. Max rendering time is 60.0s

The example from Geoserver (the one using restricted layer vs bug sites) doesn't have this problem. I'm wondering if I'm writing the query wrong, whether my PC's just not up to it, or something else. Should I be doing this in WFS instead?

Best Answer

It seems you are using the cross layer filtering plugin: http://docs.geoserver.org/stable/en/user/extensions/querylayer/index.html

Did you read and apply the hints in the "optimizing the module speed" section? The hint is needed only for the 2.1.x series, the 2.2.x won't benefit from it

Related Question