Eva,

I assume you have an index on SpeciesID?

Ian

On 27 June 2016 at 15:31, emgerstner <eva-maria.gerst...@senckenberg.de>
wrote:

> Hi Jukka,
>
> i'm running PostgreSQL (with PostGIS) 9.2.14. From the Geoserver log file,
> I see that the call is converted into something like
>
>   Request: getFeature
>     service = WFS
>     version = 1.0.0
>     baseUrl = http://localhost:8080/geoserver/
>     query[0]:
>         filter = [[ SpeciesID = 16 ] OR [ SpeciesID = 17 ] OR [ SpeciesID
> = 18 ] OR [ SpeciesID = 40 ] OR [ SpeciesID = 41 ] OR ...
>
> In the PostgreSQL log, I see the following query
>
>    SELECT "SpeciesID","Name",encode(ST_AsEWKB("geom"),'base64') as "geom"
> FROM "public"."view_map" WHERE  (("SpeciesID" = 16 AND "SpeciesID" IS NOT
> NULL ) OR ("SpeciesID" = 17 AND "SpeciesID" IS NOT NULL ) OR ("SpeciesID" =
> 18 AND "SpeciesID" IS NOT NULL ) OR ...
>
> The query itself is quite slow (about 10 sec for 8000 ids), but the main
> performance loss appears to be with Geoserver. I'm not sure, but this seems
> to me an inefficient way to handle the CQL_FILTER request.
>
> Sincerely,
>
> Eva
>
>
>
> Am 27.06.2016 um 15:31 schrieb Rahkonen Jukka (MML):
>
> Hi,
>
> Probably Geoserver itself in not slow but if gets results from the data
> source slow. Where do you keep your data?
>
> -Jukka Rahkonen-
>
> ------------------------------
> Lähettäjä: emgerstner <eva-maria.gerst...@senckenberg.de>
> Lähetetty: ‎27.‎6.‎2016 16:05
> Vastaanottaja: geoserver-users@lists.sourceforge.net
> Aihe: [Geoserver-users] CQL_FILTER with IN
>
> Hello,
>
> I'm developing an web application based on OpenLayers 3 and Geoserver
> 2.9.0. In this application, the user can search in a database containing
> about 8000 entries of species with their locations. The search result is
> then displayed in a map with the locations of the found species.
>
> To this end, I first do a database query based on the search parameters
> (using PHP), which returns a list of species ids. I then forward this
> list to Geoserver with a WFS request using CQL_FILTER such as
>
>    CQL_FILTER=SpeciesID IN (16,17,18,40,41,...)
>
> Geoserver then returns a map with only these species in the search
> result, which is fine. However, I run into performance problems when the
> list of ids becomes too large. For 8000 ids, it takes Geoserver about 2
> minutes to draw the map which is way too long. The database query may
> return anything between 0 and 8000 results.
>
> Is there another way to solve this problem more efficiently or some way
> I can optimize Geoserver for this? I would be glad for any help.
>
> Sincerely,
>
> Eva
>
>
>
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
>
>
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>


-- 
Ian Turton
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to