Ken Bisland created GEOT-4078:
---------------------------------

             Summary: Selects all when retrieving an SRID
                 Key: GEOT-4078
                 URL: https://jira.codehaus.org/browse/GEOT-4078
             Project: GeoTools
          Issue Type: Bug
          Components: jdbc-sqlserver plugin
    Affects Versions: 2.7.4
         Environment: Geoserver 2.1-SNAPSHOT
Apache Tomcat 6.0
6.0.33 1.6.0_24-b07 Sun Microsystems Inc. 
Windows Server 2008  x86 
            Reporter: Ken Bisland


I am trying to attach a large table (18million rows) from SQL2008 to geoserver. 
 When creating the new layer from within geoserver or reloading geoserver the 
following call is being run on SQL Server.

SELECT "geom".STSrid FROM "theTable" WHERE "geom" IS NOT NULL.

This loads 18 million rows to query the Srid.

I suggest that SQLServerDialect.java is updated to select just the 1 required 
row.  In particular Line 155 which is in the getGeometrySRID function should be 
updated from:

        StringBuffer sql = new StringBuffer("SELECT ");

To
        StringBuffer sql = new StringBuffer("SELECT TOP 1 ");

 


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to