by David Crowther
Question:
Why are some of my GeoServer WMS Layers running slowly?
Answer:
One reason that your GeoServer WMS may be displaying slowly is if there is a CQL filter on the layer.
CQL – Common Query Language, is a version of SQL, that GeoServer uses in order to filter records in a source table, to then only show those features that meet certain criteria within the WMS.
A CQL filter is applied in the Layer Settings in GeoServer via the DATA tab.
The example below, shows a Land Terrier layer being filtered where the Code field is equal to ‘Easement’.
This means that instead of GeoServer simply showing all the features from the source table. GeoServer instead has to do an on-the-fly query against the source table to filter the data and only display those records that meet the criteria.
Even though GeoServer is rendering fewer records, conversely because it has to run a CQL filer at runtime, these layers can render slower than a full dataset. This is because GeoServer has to interact with the source dataset to query the chosen column and select out just the features that are required.
To help with this possible performance constraint, you may wish to add Indexes to those columns in your source dataset that are being used for these CQL filters.
This Land Terrier data is stored in a SQL Database, so using the SQL statement below we can add an Index to the Code field in the Land Terrier SQL table.
CREATE INDEX idx_landterrier_code
ON landterrier (code);
Once the index has been created on this field, try your GeoServer layers again to see if this has helped with their performance!
Comments (0 comments)