Hi Marcin,
that looks like a bug to me, I have open a JIRA ticket for it:
https://osgeo-org.atlassian.net/browse/GEOS-10108

Kind regards,
Nuno Oliveira


On Sat, Jun 12, 2021 at 6:24 AM Marcin Grudzień <mgrudzi...@gmail.com>
wrote:

> Hi Nuno,
>
> I have already analysed the SQL requests sends by GeoServer to PostGIS 12
> database. The problem lies in the following request
>
> SELECT COUNT(DISTINCT "schema_name"."table_name"."primary_key_attribute")
> FROM "schema_name"."table_name"
> in my particular case the request looks like this
> SELECT COUNT(DISTINCT "bdot"."landcoversurface"."objectid") FROM
> "bdot"."landcoversurface"
>
> The request is sent to the database, although the counting is disabled in
> GeoServer for this specific layer.
>
> Following the App Schema idExpression documentation, I removed the primary
> key from the "objectid" attribute. In order to have gml:id generated as
> <the table name>.<generated gml id>, e.g.
> landcoversurface.fid--46fd41b8_1407138b56f_-7fe0
>
> However, for some reason gml:id was always created utilising this
> "objectid" attribute. Even if I changed the attribute name after restarting
> the GeoServer the attribute with the changed name was used to create
> gml:id. I also tried setting up the parameter "Expose primary keys" to
> "false", but it didn't help.
>
> It is important to add that the "objectid" attribute has an index in the
> database.
>
> Best regards,
> Marcin
>
>
>
>
>
> On Sat, 12 Jun 2021 at 00:51, Nuno Oliveira <
> nuno.olive...@geo-solutions.it> wrote:
>
>> Hi,
>> indeed 10 seconds seems too much ... you may want to switch the log level
>> to GEOTOOLS_DEVEL and analyze the requests that are sent to PostgreSQL.
>>
>> Kind regards,
>> Nuno Oliveira
>>
>> On Tue, Jun 8, 2021 at 12:28 PM Julian Hollingbery <jul...@northtech.dk>
>> wrote:
>>
>>> Hi,
>>>
>>>
>>>
>>> It is not unknown to have slow counting in PostgreSQL:
>>> https://wiki.postgresql.org/wiki/Slow_Counting and
>>> https://www.cybertec-postgresql.com/en/postgresql-count-made-fast/
>>>
>>> I always try to avoid using the count-parameter, as the implications
>>> don’t seem user-friendly to me.
>>>
>>>
>>>
>>> Regards,
>>>
>>> Julian
>>>
>>>
>>>
>>> *Fra:* Nuno Oliveira <nuno.olive...@geo-solutions.it>
>>> *Sendt:* 08 June 2021 13:07
>>> *Til:* Marcin Grudzień <mgrudzi...@gmail.com>
>>> *Cc:* GeoServer Mailing List List <geoserver-users@lists.sourceforge.net
>>> >
>>> *Emne:* Re: [Geoserver-users] App-schema - long WFS GetFeature response
>>> times without BBOX
>>>
>>>
>>>
>>> Hi Marcin,
>>>
>>> a simple count without any filter usually should not take that much
>>> time, I suspect that there may be something else having an impact on the
>>> performance.
>>>
>>>
>>>
>>> That say, it is possible to deactivate the number matched count on the
>>> layer configuration page unter the publishing tab:
>>>
>>>
>>> https://drive.google.com/file/d/1mx_1fPVJAu9ElgOcVwuXfOq30n6ONmKw/view?usp=sharing
>>>
>>>
>>>
>>> Hope this helps,
>>>
>>> Nuno Oliveira
>>>
>>>
>>>
>>> On Tue, Jun 1, 2021 at 2:44 PM Marcin Grudzień <mgrudzi...@gmail.com>
>>> wrote:
>>>
>>> Hi,
>>>
>>>
>>>
>>> I have published INSPIRE Land Cover WFS service using Geoserver 2.19.1
>>> with app-schema extension. The service is available at
>>> https://mapy.geoportal.gov.pl/wss/service/wfsLCV/guest?service=WFS&request=GetCapabilities
>>>
>>>
>>>
>>> The data is stored in the PostGIS database.
>>>
>>>
>>>
>>> The service publishes over 6 000 000 land cover objects.
>>>
>>>
>>>
>>> I noticed that it takes around 20 seconds for the service to return the
>>> response to the most basic GetFeature request
>>> https://mapy.geoportal.gov.pl/wss/service/wfsLCV/guest?service=WFS&request=GetFeature&version=2.0.0&TYPENAMES=lcv:LandCoverUnit&count=1
>>>
>>>
>>>
>>>
>>> However, if I add the BBOX parameter to the request, significantly
>>> limiting the area of the request, the response times are much better. E.g.
>>> https://mapy.geoportal.gov.pl/wss/service/wfsLCV/guest?service=WFS&request=GetFeature&version=2.0.0&TYPENAMES=lcv:LandCoverUnit&count=100&BBOX=500000,500000,600000,600000
>>> takes around 2 seconds.
>>>
>>>
>>>
>>> I suspect that such GeoServer behaviour is related to the fact that the
>>> server wants to establish the total number of features that can be
>>> downloaded by the service (attribute numberMatched) and is doing it for the
>>> full BBOX defined for the lcv:LandCoverUnit feature type in the service
>>> GetCapabilities response.
>>>
>>>
>>>
>>> I would be grateful for any suggestion regarding lowering the response
>>> times for the non-spatial GetFeature requests.
>>>
>>>
>>>
>>> Best regards,
>>>
>>> Marcin
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
>>>
>>>
>>>
>>> --
>>>
>>> Regards,
>>> Nuno Oliveira
>>> ==
>>> GeoServer Professional Services from the experts!
>>> Visit http://goo.gl/it488V for more information.
>>> ==
>>>
>>> Nuno Miguel Carvalho Oliveira
>>> @nmcoliveira
>>> Software Engineer
>>>
>>> GeoSolutions S.A.S.
>>> Via di Montramito 3/A
>>> 55054  Massarosa (LU)
>>> Italy
>>> phone: +39 0584 962313
>>> fax:      +39 0584 1660272
>>>
>>> http://www.geo-solutions.it
>>> http://twitter.com/geosolutions_it
>>>
>>> -------------------------------------------------------
>>>
>>> Con riferimento alla normativa sul trattamento dei dati
>>> personali (Reg. UE 2016/679 - Regolamento generale sulla
>>> protezione dei dati “GDPR”), si precisa che ogni
>>> circostanza inerente alla presente email (il suo contenuto,
>>> gli eventuali allegati, etc.) è un dato la cui conoscenza
>>> è riservata al/i solo/i destinatario/i indicati dallo
>>> scrivente. Se il messaggio Le è giunto per errore, è
>>> tenuta/o a cancellarlo, ogni altra operazione è illecita.
>>> Le sarei comunque grato se potesse darmene notizia.
>>>
>>> This email is intended only for the person or entity to
>>> which it is addressed and may contain information that
>>> is privileged, confidential or otherwise protected from
>>> disclosure. We remind that - as provided by European
>>> Regulation 2016/679 “GDPR” - copying, dissemination or
>>> use of this e-mail or the information herein by anyone
>>> other than the intended recipient is prohibited. If you
>>> have received this email by mistake, please notify
>>> us immediately by telephone or e-mail.
>>> _______________________________________________
>>> 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
>>>
>>
>>
>> --
>> Regards,
>> Nuno Oliveira
>> ==
>> GeoServer Professional Services from the experts!
>> Visit http://goo.gl/it488V for more information.
>> ==
>>
>> Nuno Miguel Carvalho Oliveira
>> @nmcoliveira
>> Software Engineer
>>
>> GeoSolutions S.A.S.
>> Via di Montramito 3/A
>> 55054  Massarosa (LU)
>> Italy
>> phone: +39 0584 962313
>> fax:      +39 0584 1660272
>>
>> http://www.geo-solutions.it
>> http://twitter.com/geosolutions_it
>>
>> -------------------------------------------------------
>>
>> Con riferimento alla normativa sul trattamento dei dati
>> personali (Reg. UE 2016/679 - Regolamento generale sulla
>> protezione dei dati “GDPR”), si precisa che ogni
>> circostanza inerente alla presente email (il suo contenuto,
>> gli eventuali allegati, etc.) è un dato la cui conoscenza
>> è riservata al/i solo/i destinatario/i indicati dallo
>> scrivente. Se il messaggio Le è giunto per errore, è
>> tenuta/o a cancellarlo, ogni altra operazione è illecita.
>> Le sarei comunque grato se potesse darmene notizia.
>>
>> This email is intended only for the person or entity to
>> which it is addressed and may contain information that
>> is privileged, confidential or otherwise protected from
>> disclosure. We remind that - as provided by European
>> Regulation 2016/679 “GDPR” - copying, dissemination or
>> use of this e-mail or the information herein by anyone
>> other than the intended recipient is prohibited. If you
>> have received this email by mistake, please notify
>> us immediately by telephone or e-mail.
>> _______________________________________________
>> 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
>>
>

-- 
Regards,
Nuno Oliveira
==
GeoServer Professional Services from the experts!
Visit http://goo.gl/it488V for more information.
==

Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:      +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati
personali (Reg. UE 2016/679 - Regolamento generale sulla
protezione dei dati “GDPR”), si precisa che ogni
circostanza inerente alla presente email (il suo contenuto,
gli eventuali allegati, etc.) è un dato la cui conoscenza
è riservata al/i solo/i destinatario/i indicati dallo
scrivente. Se il messaggio Le è giunto per errore, è
tenuta/o a cancellarlo, ogni altra operazione è illecita.
Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to
which it is addressed and may contain information that
is privileged, confidential or otherwise protected from
disclosure. We remind that - as provided by European
Regulation 2016/679 “GDPR” - copying, dissemination or
use of this e-mail or the information herein by anyone
other than the intended recipient is prohibited. If you
have received this email by mistake, please notify
us immediately by telephone or e-mail.
_______________________________________________
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

Reply via email to