Table checking (LIMIT 1) queries can prevent GeoServer from starting for view with ORDER BY constraints
-------------------------------------------------------------------------------------------------------
Key: GEOS-1431
URL: http://jira.codehaus.org/browse/GEOS-1431
Project: GeoServer
Issue Type: Bug
Components: PostGIS
Affects Versions: 1.4.1
Environment: GeoServer 1.4.1
O.S.: Windows Server 2003 with SP1
Web Server: IIS
Servlet Container: Jetty
PostgreSQL/PostGIS 8.0.x database backend on Linux RHE 4.0
Reporter: Steve Marshall
Assignee: Andrea Aime
Priority: Minor
Severe performance problems can occur when a feature is built on top of a Postgresql database view, and the view contains ORDER BY constraints. In these cases, a query without a WHERE clause, but with a LIMIT 1 constraint can take a very long time to run. Such queries are used by the GeoServer PostGIS driver to determine if a table or view is valid. Such checking occurs for all feature types when GeoServer starts. If one of these queries takes a very long time, it can time out. Such timeouts are interpretted as errors that prevent GeoServer from starting.
This can be fixed by checking table/view existance in another way. One option would be to use a query to the information_schema.tables view (supported by PostgreSQL since version 7.3). Another option would be to use a "LIMIT 0" constraint, instead of LIMIT 1. These perform much faster than LIMIT 1 queries, but will still throw an error if the table does not exist. I have personally tested that LIMIT 0 constraints work in PostgreSQL versions as early as 7.3, but I believe they are supported even earlier.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira