Hi Andrea,
I can see the line where the change needs to be made but I am not a java
programmer so not sure how to create a patch or how to submit it. Happy to do
it if you can provide some guidance on generating/submitting a patch. If not,
would you be able to do it? I would change the first line of the
getGeometrySRID function to:
StringBuffer sql = new StringBuffer("SELECT TOP 1 ");
This will then only select the single row that the rest of the code uses.
Many Thanks,
Ken
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Andrea
Aime
Sent: 16 March 2012 13:20
To: Bisland, Kenneth
Cc: [email protected]
Subject: Re: [Geoserver-users] Geoserver and large tables
On Fri, Mar 16, 2012 at 12:31 PM, Bisland, Kenneth
<[email protected]> wrote:
> Hi,
>
>
>
> 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.
>
>
>
> That is a very large query on 18 million rows. I assume this is to look up
> the SRID of the table. Can this query be disabled or rewritten to return
> only a few rows?
Yes, it can be done, but it requires a code change in this GeoTools class:
http://svn.osgeo.org/geotools/trunk/modules/plugin/jdbc/jdbc-sqlserver/src/main/java/org/geotools/data/sqlserver/SQLServerDialect.java
Patches welcomed :-)
Cheers
Andrea
--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549
http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf
-------------------------------------------------------
**********************************************************************
This e-mail from Ultra Electronics Limited and any attachments to it are
confidential to
the intended recipient and may also be privileged. If you have received it in
error please
notify the sender and delete it from your system. If you are not the intended
recipient
you must not copy it or use it for any purpose nor disclose or distribute its
contents to
any other person. All communications may be subject to interception or
monitoring for
operational and/or security purposes. Please rely on your own virus checking as
the sender
cannot accept any liability for any damage arising from any bug or virus
infection.
Ultra Electronics Limited is a company registered in England and Wales,
registration number
2830644. The address of its registered office is 417 Bridport Road, Greenford,
Middlesex, UB6 8UA.
**********************************************************************
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users