<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SQL 2008 Spatial Query Layer Indexing in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/sql-2008-spatial-query-layer-indexing/m-p/595907#M33599</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Only a workaround till MS fix the bug (I hope). But after reading the second post in this thread &lt;/SPAN&gt;&lt;A href="http://social.msdn.microsoft.com/Forums/en/sqlspatial/thread/1d7c3d89-c9bf-4338-869b-a9d563a81838"&gt;http://social.msdn.microsoft.com/Forums/en/sqlspatial/thread/1d7c3d89-c9bf-4338-869b-a9d563a81838&lt;/A&gt;&lt;SPAN&gt; I added a not very selective index to a GEOGRAPHY table and now SDE benefits from the Spatial Index.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By adding a definition query such as for eg. WHERE PERENNIAL IN ('1','2','3') - Perennial being a field in a table of hundreds of thousands of records with an index that has only 3 categories (not very selective) the SQL Server Query Optimiser has decided that the Spatial Index is lesser cost than the current clustered index scan and rendering via SDE is now order of magnitudes faster at lesser scales.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not ideal but till the bug's fixed it will have to do...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Apr 2011 04:21:08 GMT</pubDate>
    <dc:creator>richwebb</dc:creator>
    <dc:date>2011-04-04T04:21:08Z</dc:date>
    <item>
      <title>SQL 2008 Spatial Query Layer Indexing</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-2008-spatial-query-layer-indexing/m-p/595904#M33596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am after some assistance with getting ArcGIS Desktop to use a spatial index I have set up on a large database with 3 million records.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There query ArcGIS uses (picking up via SQL profiler) is&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;declare @bb geometry&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;select @bb = geometry::STGeomFromText('POLYGON((338293500 126983400,338538336 126983400,338538336 126808775,338293500 126808775,338293500 126983400))',0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;select ST_NUM, FEANME, FEATYP, DIRSUF, MUN, COM_NME, ESZ, MSG, MSLINK, TEXT_ID, X_CORD, Y_CORD, FEA_MSLINK, VICMAP_ADDRESS_PFI, VICMAP_ROAD_PFI, CAD_STRING, GEOM, 1 as "ESRI_OID" from (select * from LIVE_MAPDATA.dbo.ADDRESS) a &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;where GEOM.STIntersects(@bb) = 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This takes about 29 seconds to run.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I re-write the query with an index hint it returns almost instantly&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;select ST_NUM, FEANME, FEATYP, DIRSUF, MUN, COM_NME, ESZ, MSG, MSLINK, TEXT_ID, X_CORD, Y_CORD, FEA_MSLINK, VICMAP_ADDRESS_PFI, VICMAP_ROAD_PFI, CAD_STRING, GEOM, 1 as "ESRI_OID" from lIVE_MAPDATA.dbo.ADDRESS a with(index(IX_ADDRESS_SPATIAL))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;where GEOM.STIntersects(@bb) = 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anybody know how I can get ArcGIS to make use of the spatial indexing in SQL 2008 for query layers?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrew Wise&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GIS Specialist&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Emergency Services Telecommunications Authority&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Melbourne, VIC, Australuia&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jan 2011 02:18:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-2008-spatial-query-layer-indexing/m-p/595904#M33596</guid>
      <dc:creator>AndrewWise</dc:creator>
      <dc:date>2011-01-13T02:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: SQL 2008 Spatial Query Layer Indexing</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-2008-spatial-query-layer-indexing/m-p/595905#M33597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Andrew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What version of SQL Server 2008 are you using?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you seen the list of bugs fixed by Microsoft with SQL Server 2008 sp1?&amp;nbsp; One of these causes the optimizer to use the spatial index when its use is appropriate whereas in the initial SQL 2008 release this was not the case.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://support.microsoft.com/kb/968369"&gt;http://support.microsoft.com/kb/968369&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jan 2011 13:16:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-2008-spatial-query-layer-indexing/m-p/595905#M33597</guid>
      <dc:creator>JonDeRose</dc:creator>
      <dc:date>2011-01-14T13:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: SQL 2008 Spatial Query Layer Indexing</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-2008-spatial-query-layer-indexing/m-p/595906#M33598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yeah I did see that but we are running SP2:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (X64)&amp;nbsp;&amp;nbsp; Jul&amp;nbsp; 9 2008 14:17:44&amp;nbsp;&amp;nbsp; Copyright (c) 1988-2008 Microsoft Corporation&amp;nbsp; Standard Edition (64-bit) on Windows NT 5.2 &amp;lt;X64&amp;gt; (Build 3790: Service Pack 2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Seems like something that should be added by ArcGIS / forced option when adding a query layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;eg &lt;X&gt; Use spatial index hints on this layer&lt;/X&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jan 2011 21:49:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-2008-spatial-query-layer-indexing/m-p/595906#M33598</guid>
      <dc:creator>AndrewWise</dc:creator>
      <dc:date>2011-01-18T21:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: SQL 2008 Spatial Query Layer Indexing</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-2008-spatial-query-layer-indexing/m-p/595907#M33599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Only a workaround till MS fix the bug (I hope). But after reading the second post in this thread &lt;/SPAN&gt;&lt;A href="http://social.msdn.microsoft.com/Forums/en/sqlspatial/thread/1d7c3d89-c9bf-4338-869b-a9d563a81838"&gt;http://social.msdn.microsoft.com/Forums/en/sqlspatial/thread/1d7c3d89-c9bf-4338-869b-a9d563a81838&lt;/A&gt;&lt;SPAN&gt; I added a not very selective index to a GEOGRAPHY table and now SDE benefits from the Spatial Index.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By adding a definition query such as for eg. WHERE PERENNIAL IN ('1','2','3') - Perennial being a field in a table of hundreds of thousands of records with an index that has only 3 categories (not very selective) the SQL Server Query Optimiser has decided that the Spatial Index is lesser cost than the current clustered index scan and rendering via SDE is now order of magnitudes faster at lesser scales.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not ideal but till the bug's fixed it will have to do...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2011 04:21:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-2008-spatial-query-layer-indexing/m-p/595907#M33599</guid>
      <dc:creator>richwebb</dc:creator>
      <dc:date>2011-04-04T04:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: SQL 2008 Spatial Query Layer Indexing</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-2008-spatial-query-layer-indexing/m-p/595908#M33600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;so if I am reading right, you essentially had to fool SQL server to use the more efficient index by creating a less efficient one?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2011 14:42:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-2008-spatial-query-layer-indexing/m-p/595908#M33600</guid>
      <dc:creator>JosephWallis</dc:creator>
      <dc:date>2011-08-11T14:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: SQL 2008 Spatial Query Layer Indexing</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-2008-spatial-query-layer-indexing/m-p/595909#M33601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If your SQL 2008 R2 is on a multiprocessor server see this article, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://support.esri.com/en/knowledgebase/techarticles/detail/38871"&gt;http://support.esri.com/en/knowledgebase/techarticles/detail/38871&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or the reply from Ed Katibah in this thread,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/33970-SQL-Server-Native-Types-Pros-and-Cons"&gt;http://forums.arcgis.com/threads/33970-SQL-Server-Native-Types-Pros-and-Cons&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In UC, I talked to a couple of ESRI experts about spatial index. They recommanded to test different spatial grid properties. For example, the default is medium, medium,medium, medium, you can try low,medium,medium,medium or low,low,medium,medium, etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my SDE GDB, the property change didn't help. However, the test is so easy, it may be worth to just try it on a slow FC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2011 15:50:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-2008-spatial-query-layer-indexing/m-p/595909#M33601</guid>
      <dc:creator>RobertHu</dc:creator>
      <dc:date>2011-08-11T15:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: SQL 2008 Spatial Query Layer Indexing</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-2008-spatial-query-layer-indexing/m-p/595910#M33602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;yeah I tried altering the spatial index levels to no avail.&amp;nbsp; I think I'll try this on R2 with that hotfix though.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Aug 2011 14:03:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-2008-spatial-query-layer-indexing/m-p/595910#M33602</guid>
      <dc:creator>JosephWallis</dc:creator>
      <dc:date>2011-08-12T14:03:39Z</dc:date>
    </item>
  </channel>
</rss>

