[Geoserver-devel] [JIRA] (GEOS-10725) [WFS] : GetFeature Performance with jdbc plugin

Erwan Ropartz created an issue

GeoServer / BugGEOS-10725

[WFS] : GetFeature Performance with jdbc plugin

Issue Type:

BugBug

Affects Versions:

2.22-RC

Assignee:

Unassigned

Components:

WFS

Created:

27/Oct/22 4:52 PM

Priority:

MediumMedium

Reporter:

Erwan Ropartz

WFS request with a massive attribute filter (1000 PropertyIsEqual for example) is slower when jdbc config is enabled

For example in our environment:

  • Geoserver with config in datadir : 2s
  • Geoserver with config in database : 27s

After some analysis, this difference is made by the catalognamespacesupport that not used the jdbc cache to load namespaces

  • The property name is parsed with Geotools :

    •   //org.geotools.filter.v2_0.bindings.PropertyNameTypeBinding
        if (factory instanceof FilterFactory2) {
            return factory.property(
                    propertyName.getPropertyName(),
                    GML3EncodingUtils.copyNamespaceSupport(namespaceSupport));
        }
      
  • GML3EncodingUtils load all prefixes with the namespace support (line 3)

    •   public static NamespaceSupport copyNamespaceSupport(NamespaceSupport namespaceSupport) {
                NamespaceSupport copy = new NamespaceSupport();
                Enumeration prefixes = namespaceSupport.getPrefixes();
                while (prefixes.hasMoreElements()) {
                    String prefix = (String) prefixes.nextElement();
                    String uri = namespaceSupport.getURI(prefix);
                    copy.declarePrefix(prefix, uri);
                }
                // the above did not cover the default prefix
                String defaultUri = namespaceSupport.getURI("");
                if (defaultUri != null) {
                    copy.declarePrefix("", defaultUri);
                }
      
                return copy;
            }
      
  • The catalogNamespace support use method list to load prefixes. This method not use the cache in jdbcconfig

    •   public Enumeration getPrefixes() {
           @SuppressWarnings("PMD.CloseResource") // best effort closing
           final CloseableIterator<NamespaceInfo> it =
                   catalog.list(NamespaceInfo.class, Predicates.acceptAll());
        }
      

Pull request in progress

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100209-sha1:d23b292)

Atlassian logo