one layer two database queries

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

one layer two database queries

Arnaud L.
Hi list

I see in the debug log that when I query a specific layer via WMS,
geoserver queries my postgis table twice.
The bbox for both queries is slightly different because the stroke width
for both queries is different.
It seems like this is unnecesssary overhead to me. What is causing this
"double query", and how can I fix it ?
Thanks !

Regards
--
Arnaud


_______________________________________________
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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: one layer two database queries

geowolf
Hi Arnaud,
can you share the exact request you're making and the full SLD involved?

Cheers
Andrea

On Thu, Jan 24, 2019 at 11:11 AM Arnaud L. <[hidden email]> wrote:
Hi list

I see in the debug log that when I query a specific layer via WMS,
geoserver queries my postgis table twice.
The bbox for both queries is slightly different because the stroke width
for both queries is different.
It seems like this is unnecesssary overhead to me. What is causing this
"double query", and how can I fix it ?
Thanks !

Regards
--
Arnaud


_______________________________________________
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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users


--

Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: one layer two database queries

Arnaud L.
Hi Andrea

Le 24/01/2019 à 12:22, Andrea Aime a écrit :
> can you share the exact request you're making and the full SLD involved?

Sure !

The query is :
http://geoserver:8888/geoserver/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=false&STYLES=&TILED=false&CRS=EPSG:32631&LAYERS=osm:web_polygons&WIDTH=1200&HEIGHT=1200&BBOX=130683,4823333,132207,4824857

The SLD (actually it's YSLD, hope it's fine) is here :
https://pastebin.com/TQwzu4Pb

Also, here are the two queries (not sure they are in this order, I think
they are reversed) :
https://pastebin.com/CryUBDbu

I've set a one day expiration on the two pastes.

Cheers !

--
Arnaud


_______________________________________________
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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: one layer two database queries

geowolf
On Thu, Jan 24, 2019 at 12:37 PM Arnaud L. <[hidden email]> wrote:
The SLD (actually it's YSLD, hope it's fine)

For me, it isn't, I really dislike that language. If it was a consultancy under contract, I would not mind too much, but as a volunteer, sorry, I won't have a look at it.

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: one layer two database queries

Arnaud L.
Le 24/01/2019 à 13:09, Andrea Aime a écrit :
> On Thu, Jan 24, 2019 at 12:37 PM Arnaud L. <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     The SLD (actually it's YSLD, hope it's fine)
>
> For me, it isn't, I really dislike that language.
No problem, here is the same style in SLD :
https://pastebin.com/Nsief1vf

Cheers
--
Arnaud


_______________________________________________
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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

single rule style does not display label in getlegendgraphic

Paul van Genuchten
In reply to this post by geowolf
Consider the 2 styles below. The first style does not display a label, but the second style does display a label for each rule on the legend graphic. This behavior is intentional? We’d imagine the label would be displayed on both cases.

<FeatureTypeStyle>
<Rule>
<Name>My label</Name>
<Title>My label</Title>
<PolygonSymbolizer>
<Fill>
<CssParameter
name="fill">#CCFCF5</CssParameter>
</Fill>
</PolygonSymbolizer>
</Rule>
</FeatureTypeStyle>

and

<FeatureTypeStyle>
<Rule>
<Name>My label</Name>
<Title>My label</Title>
<PolygonSymbolizer>
<Fill>
<CssParameter
name="fill">#CCFCF5</CssParameter>
</Fill>
</PolygonSymbolizer>
</Rule>
<Rule>
<Name>My label 2</Name>
<Title>My label 2</Title>
<PolygonSymbolizer>
<Fill>
<CssParameter
name="fill">#00FF00</CssParameter>
</Fill>
</PolygonSymbolizer>
</Rule>
</FeatureTypeStyle>





_______________________________________________
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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: one layer two database queries

geowolf
In reply to this post by Arnaud L.
On Thu, Jan 24, 2019 at 1:51 PM Arnaud L. <[hidden email]> wrote:
> For me, it isn't, I really dislike that language.
No problem, here is the same style in SLD :
https://pastebin.com/Nsief1vf

Thank you!
Wow, it's big... and the feature type names are not a match for the table names you're using, seems like you're using SQL views?
And while the target table is the same, the sql view definition is not. More in general, there are no facilities to figure out
that two feature type styles are based on the same base table and eventually reorganize the queries accordingly, the renderer
only sees the feature types, has no idea what's behind them, and queries them one by one.
Well, that is, unless you mean that a specific user visible layer, with one name, is causing two different queries? But I don't
see that from your query logs.

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: one layer two database queries

geowolf
Wait, actualy the VTABLE contents is the same... ok, so same SQL view? Or do you have
two separate sql views with the same definition?
Is it possible to have only the style that actually causes the two queries, without everything else?

Cheers
Andrea


On Thu, Jan 24, 2019 at 2:11 PM Andrea Aime <[hidden email]> wrote:
On Thu, Jan 24, 2019 at 1:51 PM Arnaud L. <[hidden email]> wrote:
> For me, it isn't, I really dislike that language.
No problem, here is the same style in SLD :
https://pastebin.com/Nsief1vf

Thank you!
Wow, it's big... and the feature type names are not a match for the table names you're using, seems like you're using SQL views?
And while the target table is the same, the sql view definition is not. More in general, there are no facilities to figure out
that two feature type styles are based on the same base table and eventually reorganize the queries accordingly, the renderer
only sees the feature types, has no idea what's behind them, and queries them one by one.
Well, that is, unless you mean that a specific user visible layer, with one name, is causing two different queries? But I don't
see that from your query logs.

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 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.



--

Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: one layer two database queries

Arnaud L.
In reply to this post by geowolf
Le 24/01/2019 à 14:11, Andrea Aime a écrit :
> Wow, it's big... and the feature type names are not a match for the
> table names you're using, seems like you're using SQL views?

Yes, SQL view, but basically only selecting all the columns (and doing
simple CASE ... WHEN statement to do things that would be more difficult
in SLD) and filtering on a boolean field.


> And while the target table is the same, the sql view definition is not.

What do you mean ?
The SQL view definition is the same, since it's only one single layer.

What is different though is what is added by geoserver, i.e. whats is
after the "AS vtable". But everything inside the subquery (i.e. the view
definition) is the same.


> More in general, there are no facilities to figure out
> that two feature type styles are based on the same base table and
> eventually reorganize the queries accordingly, the renderer
> only sees the feature types, has no idea what's behind them, and queries
> them one by one.
> Well, that is, unless you mean that a specific user visible layer, with
> one name, is causing two different queries? But I don't
> see that from your query logs.

Yes, that's exactly what I mean. I query a single layer (base on the SQL
view that you can see inside the "vtable" subquery) using the URL that I
previously posted.
Geoserver then issues two different queries, the first time with a part
of the feature type styles, and the second type with the rest of it.


Actually the style is not that big (very subjective, of course), it's a
rendering based on a very simplified version of openstreetmap's
"planet_osm_polygon" table, with a lot less features than on OSM's own
style.


Cheers
--
Arnaud


_______________________________________________
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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: one layer two database queries

Arnaud L.
In reply to this post by geowolf
Le 24/01/2019 à 14:14, Andrea Aime a écrit :
> Wait, actualy the VTABLE contents is the same... ok, so same SQL view?
> Or do you have
> two separate sql views with the same definition?

No, you got it. One SQL view, one layer.


> Is it possible to have only the style that actually causes the two
> queries, without everything else?

I don't know what causes the two queries.
It looks like half of the features are extracted with the first query
and the remaining half with the other one.
This SLD is used only on this layer. There are no extra feature type
styles in it.


Cheers
--
Arnaud


_______________________________________________
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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: single rule style does not display label in getlegendgraphic

geowolf
In reply to this post by Paul van Genuchten
Hi Paul,
it has always behaved like this, for as long as I can remember. I believe the idea was that if there is only a rule to paint,
it's best not to add a label so that the client can do it itself... because a client can ask for a specific rule.
But I'm guessing if the user did not ask for a specific rule, then the label should be there.
As a workaround, there is a vendor option to force labels to appear regardless, check the documentation

Cheers
Andrea


On Thu, Jan 24, 2019 at 2:02 PM Paul van Genuchten <[hidden email]> wrote:
Consider the 2 styles below. The first style does not display a label, but the second style does display a label for each rule on the legend graphic. This behavior is intentional? We’d imagine the label would be displayed on both cases.

<FeatureTypeStyle>
<Rule>
<Name>My label</Name>
<Title>My label</Title>
<PolygonSymbolizer>
<Fill>
<CssParameter
name="fill">#CCFCF5</CssParameter>
</Fill>
</PolygonSymbolizer>
</Rule>
</FeatureTypeStyle>

and

<FeatureTypeStyle>
<Rule>
<Name>My label</Name>
<Title>My label</Title>
<PolygonSymbolizer>
<Fill>
<CssParameter
name="fill">#CCFCF5</CssParameter>
</Fill>
</PolygonSymbolizer>
</Rule>
<Rule>
<Name>My label 2</Name>
<Title>My label 2</Title>
<PolygonSymbolizer>
<Fill>
<CssParameter
name="fill">#00FF00</CssParameter>
</Fill>
</PolygonSymbolizer>
</Rule>
</FeatureTypeStyle>



_______________________________________________
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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users


--

Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: one layer two database queries

geowolf
In reply to this post by Arnaud L.
On Thu, Jan 24, 2019 at 2:23 PM Arnaud L. <[hidden email]> wrote:
What do you mean ?
The SQL view definition is the same, since it's only one single layer.

Oh dear, now I see it... and it's truly horrible! :-D
I thought the various FeatureTypeStyle had a different FeatureTypeName, but it's just a different Name instead.
FeatureTypeStyles are very heavy objects rendering wise, you should not use them as mere classifiers.
Every time you create a FeatureTypeStyle, a new z level in the map is created. GeoServer handles it in two ways:
  • if possible, it tries to reuse the same data source as the previous feature type style, but to respect the z ordering it allocates a transparent rendering surface, as big as the output map, where the features captured by the rules of this FTS will be painted, and will merge the various FTS rendering surfaces at the end
  • otherwise, it will execute separate requests
This means that even in the best of conditions, with that style GeoServer would be allocating tens of drawing surfaces, with an insane memory usage going with it (I think I see 42 FeatureTypeStyles, for a 4x4 metatile , 1024x1024, 4 bytes per pixel, that would be 168MB of RAM (you don't get that high, see below, the stacks of rendering surfaces are actually split in two).
So why is it doing two queries anyways? Because you have two different names for the sortGroup, which makes the various feature type styles un-mergeable.

Do yourself a favor and, if possible, use a single FeatureTypeStyle instead ;-)

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: one layer two database queries

Arnaud L.
Le 25/01/2019 à 10:34, Andrea Aime a écrit :
> Oh dear, now I see it... and it's truly horrible! :-D
> I thought the various FeatureTypeStyle had a different FeatureTypeName,
> but it's just a different Name instead.
> FeatureTypeStyles are very heavy objects rendering wise, you should not
> use them as mere classifiers.
> Every time you create a FeatureTypeStyle, a new z level in the map is
> created.

So creating a new z level for each FeatureTypeStyle is pretty much what
was intended.


> This means that even in the best of conditions, with that style
> GeoServer would be allocating tens of drawing surfaces, with an insane
> memory usage going with it (I think I see 42 FeatureTypeStyles, for a
> 4x4 metatile , 1024x1024, 4 bytes per pixel, that would be 168MB of RAM
> (you don't get that high, see below, the stacks of rendering surfaces
> are actually split in two).

Now, that's indeed very bad. I do need to rewrite things.


> So why is it doing two queries anyways? Because you have two different
> names for the sortGroup, which makes the various feature type styles
> un-mergeable.

Oh OK, now I see it ! Nice pick Andrea !


> Do yourself a favor and, if possible, use a single FeatureTypeStyle
> instead ;-)

OK, I understand the problem now, very clear.
The problem is that I do need to order all these features the way I did
(i.e., for instance, 'water' on top of 'wood').

So, from what you say, the "right" way to do this would be to use a
single FeatureTypeStyle for the first sortByGroup, and use a zOrder and
add the appropriate column in my datasource ?

For the second sortByGroup, I need to have many things ordered (i.e.
road casing and roads going over/under buildings.
So in this case, I believe I do need one FeatureTypeStyle per road type
and a sortbygroup, right ?


Thanks a lot for your help Andrea !

Cheers

--
Arnaud


_______________________________________________
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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: one layer two database queries

geowolf
On Fri, Jan 25, 2019 at 11:41 AM Arnaud L. <[hidden email]> wrote:
OK, I understand the problem now, very clear.
The problem is that I do need to order all these features the way I did
(i.e., for instance, 'water' on top of 'wood').

So, from what you say, the "right" way to do this would be to use a
single FeatureTypeStyle for the first sortByGroup, and use a zOrder and
add the appropriate column in my datasource ?

Yep
 

For the second sortByGroup, I need to have many things ordered (i.e.
road casing and roads going over/under buildings.
So in this case, I believe I do need one FeatureTypeStyle per road type
and a sortbygroup, right ?

In if you have casing, a minimum of two groups is needed.
See documentation here, it shows CSS for brevity but also links to a SLD: 

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: one layer two database queries

Arnaud L.
Le 25/01/2019 à 14:12, Andrea Aime a écrit :
> In if you have casing, a minimum of two groups is needed.
> See documentation here, it shows CSS for brevity but also links to a SLD:
> https://docs.geoserver.org/latest/en/user/styling/sld/extensions/z-order/example.html

Yes, actually that's the example I followed for my own style .But I did
not understand the memory impact of having many FeatureTypeStyles and I
found it very convenient, so I went with on FTS per road class...
A lot of SLD rewriting in perspective !

Thanks a lot for these great tips Andrea !

Cheers

--
Arnaud



_______________________________________________
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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: one layer two database queries

PeterSm
Hi Arnaud

Perhaps you can update the documentation at https://docs.geoserver.org/latest/en/user/styling/sld/extensions/z-order/example.html with the lessons that you have learnt, especially the memory impact and the multiple queries.  Then we can all benefit from your experience.

If you are not familiar with contributing on GitHub, send me the changes in a Word document and I will gladly help you.

Regards

Peter

On Fri, 25 Jan 2019 at 17:20, Arnaud L. <[hidden email]> wrote:
Le 25/01/2019 à 14:12, Andrea Aime a écrit :
> In if you have casing, a minimum of two groups is needed.
> See documentation here, it shows CSS for brevity but also links to a SLD:
> https://docs.geoserver.org/latest/en/user/styling/sld/extensions/z-order/example.html

Yes, actually that's the example I followed for my own style .But I did
not understand the memory impact of having many FeatureTypeStyles and I
found it very convenient, so I went with on FTS per road class...
A lot of SLD rewriting in perspective !

Thanks a lot for these great tips Andrea !

Cheers

--
Arnaud



_______________________________________________
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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users


_______________________________________________
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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: one layer two database queries

Arnaud L.
Hi Peter

Le 25/01/2019 à 20:15, Peter Smythe a écrit :
> Perhaps you can update the documentation at
> https://docs.geoserver.org/latest/en/user/styling/sld/extensions/z-order/example.html 
> with the lessons that you have learnt, especially the memory impact and
> the multiple queries.  Then we can all benefit from your experience.
>
> If you are not familiar with contributing on GitHub, send me the changes
> in a Word document and I will gladly help you.

Not very familiar indeed, but enough to contribute I guess.
When this project is over I'll have more time to document things and
give afterthougts.
I'm not sure that the impact of multiple FeatureTypeStyles on memory
would fit in the z-order documentation though. This is a more
fundamental concept of GeoServer.
Maybe this problem of FTS and memory is not even a subject for the
documentation, but maybe a good subject for a blog post for instance.

I remember reading a documentation page on the subject, but can't get my
hand on it anymore. There was a drawing of multiple drawing canvas being
merged together. Maybe this was in relation with composition, but even
there I haven't found anything...

Cheers
--
Arnaud



_______________________________________________
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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: one layer two database queries

geowolf
On Mon, Jan 28, 2019 at 8:50 AM Arnaud L. <[hidden email]> wrote:
I remember reading a documentation page on the subject, but can't get my
hand on it anymore.

There was a mention of this topic in "GeoServer on steroids, slide 25":


And also in GeoSolutions performance optimization training material:


Cheers
Andrea

== GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: one layer two database queries

Arnaud L.
Le 28/01/2019 à 09:26, Andrea Aime a écrit :
> There was a mention of this topic in "GeoServer on steroids, slide 25":
> https://www.slideshare.net/geosolutions/geoserver-on-steroids-foss4g-2015
>
> And also in GeoSolutions performance optimization training material:
> https://geoserver.geo-solutions.it/edu/en/enterprise/styles.html#the-concept-of-featuretypestyle

Both are must reads for anybody planning a deployment of GeoServer in a
production environment !

Cheers
--
Arnaud


_______________________________________________
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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users