<?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 How to optimize performance of db view based on STIntersect? in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/how-to-optimize-performance-of-db-view-based-on/m-p/868079#M6118</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all, &lt;/P&gt;&lt;P&gt;I have a grand master plan for how I want to set up our MS SQL database when we migrate our data this summer, and part of that includes having a MASTER database that contains base data (like parcels, roads, cities) that I show as views in other databases based on various geographies. I have written a query that does this using parcels from my MASTER_GIS database and a boundary from OTHER_GDB and stores the view in OTHER_GDB. In ArcMap, however, it runs painfully slow (when it draws at all). See said SQL query below: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USE OTHER_GDB&lt;/P&gt;&lt;P&gt;GO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE VIEW dbo.parcelView&lt;/P&gt;&lt;P&gt;AS &lt;/P&gt;&lt;P&gt;SELECT parc.OBJECTID, parc.PROP_ID, parc.SITE_ADDR, parc.SHAPE&lt;/P&gt;&lt;P&gt;FROM MASTER_GIS.dbo.PARCELS AS parc&lt;/P&gt;&lt;P&gt;JOIN dbo.BOUNDARY AS boundary&lt;/P&gt;&lt;P&gt;ON&lt;/P&gt;&lt;P&gt;parc.SHAPE.STIntersects(boundary.SHAPE) = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question: Is it possible to accomplish this and end up with usable feature class in ArcMap?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Mar 2016 22:52:02 GMT</pubDate>
    <dc:creator>ForrestChevaillier1</dc:creator>
    <dc:date>2016-03-30T22:52:02Z</dc:date>
    <item>
      <title>How to optimize performance of db view based on STIntersect?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/how-to-optimize-performance-of-db-view-based-on/m-p/868079#M6118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all, &lt;/P&gt;&lt;P&gt;I have a grand master plan for how I want to set up our MS SQL database when we migrate our data this summer, and part of that includes having a MASTER database that contains base data (like parcels, roads, cities) that I show as views in other databases based on various geographies. I have written a query that does this using parcels from my MASTER_GIS database and a boundary from OTHER_GDB and stores the view in OTHER_GDB. In ArcMap, however, it runs painfully slow (when it draws at all). See said SQL query below: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USE OTHER_GDB&lt;/P&gt;&lt;P&gt;GO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE VIEW dbo.parcelView&lt;/P&gt;&lt;P&gt;AS &lt;/P&gt;&lt;P&gt;SELECT parc.OBJECTID, parc.PROP_ID, parc.SITE_ADDR, parc.SHAPE&lt;/P&gt;&lt;P&gt;FROM MASTER_GIS.dbo.PARCELS AS parc&lt;/P&gt;&lt;P&gt;JOIN dbo.BOUNDARY AS boundary&lt;/P&gt;&lt;P&gt;ON&lt;/P&gt;&lt;P&gt;parc.SHAPE.STIntersects(boundary.SHAPE) = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question: Is it possible to accomplish this and end up with usable feature class in ArcMap?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2016 22:52:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/how-to-optimize-performance-of-db-view-based-on/m-p/868079#M6118</guid>
      <dc:creator>ForrestChevaillier1</dc:creator>
      <dc:date>2016-03-30T22:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize performance of db view based on STIntersect?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/how-to-optimize-performance-of-db-view-based-on/m-p/868080#M6119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cross-database queries will usually have poor performance, which is part of the reason they're not supported by ArcGIS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to determine if anything could be done to improve this query, we'd need to know:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;How complex the "BOUNDARY" geometry is (number of vertices)&lt;/LI&gt;&lt;LI&gt;The ratio of the area of the envelope of BOUNDARY the area of the envelope of PARCELS&lt;/LI&gt;&lt;LI&gt;The exact time it takes to query BOUNDARY from a SQL prompt&lt;/LI&gt;&lt;LI&gt;The exact time it takes to query all of PARCELS from a SQL prompt&lt;/LI&gt;&lt;LI&gt;The exact time it takes to query the subset of PARCELS which intersect BOUNDARY from a SQL prompt&lt;/LI&gt;&lt;LI&gt;The exact time it takes to query the view from a SQL prompt&lt;/LI&gt;&lt;LI&gt;The exact time it takes to draw the view in ArcMap.&lt;/LI&gt;&lt;LI&gt;The spatial index options used on the PARCELS geometry column index&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 00:57:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/how-to-optimize-performance-of-db-view-based-on/m-p/868080#M6119</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2016-03-31T00:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize performance of db view based on STIntersect?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/how-to-optimize-performance-of-db-view-based-on/m-p/868081#M6120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some of SQL Server's spatial operations are known to be sensitive to the number of vertices in the polygons involved in the operations, at least this was the case with SQL Server 2008, 2008R2, and 2012 (&lt;EM&gt;I haven't revisited the issue with 2014 or newer&lt;/EM&gt;).&amp;nbsp; There are numerous MSDN threads that discuss various aspects of this issue.&amp;nbsp; Some that come to mind are:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://social.msdn.microsoft.com/Forums/sqlserver/en-US/78132bca-2a95-45c1-b93c-64c83827dc4f/sql-2k8r2-any-performance-hints-for-bulk-loading-data-from-spatialgis-db-into-a-data-warehouse?forum=sqlspatial"&gt;SQL 2K8R2: Any performance hints for bulk loading data from spatial/GIS db into a data warehouse?&lt;/A&gt;​&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://social.msdn.microsoft.com/Forums/windowsserver/en-US/3bbdc511-2a08-4075-b989-d98b70d0bedd/sql-server-express-performance-limitations-with-ogc-methods-on-geometry-instances?forum=sqlspatial"&gt;SQL Server Express Performance Limitations With OGC Methods on Geometry Instances&lt;/A&gt;​&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://social.msdn.microsoft.com/Forums/sqlserver/en-US/6e1d7af4-ecc2-4d82-b069-f2517c3276c2/slow-spatial-predicates-stcontains-stintersects-stwithin-?forum=sqlspatial"&gt;slow spatial predicates (STContains, STIntersects, STWithin, ...)&lt;/A&gt;​&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The titles might not sound relevant, but there is some good content in all three of those threads.&amp;nbsp; Personally, I have used the tessellation method put forward by Jakub K. in the aforementioned threads, and it dramatically improved performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can live with fuzzy results, i.e., a few false positives around the peripheries of your boundaries, it might be worth looking into &lt;A href="https://msdn.microsoft.com/en-us/library/cc645883.aspx"&gt;Filter &lt;/A&gt;instead of STIntersects because Filter is a "fast, index-only intersection method."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course, tuning spatial indexes can also sometimes improve performance instead of relying on the default spatial indexes that have been chosen for you when creating the feature classes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 01:18:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/how-to-optimize-performance-of-db-view-based-on/m-p/868081#M6120</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-03-31T01:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize performance of db view based on STIntersect?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/how-to-optimize-performance-of-db-view-based-on/m-p/868082#M6121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: Helvetica, sans-serif;"&gt;Thanks for the responses. I should have mentioned initially - I am a complete novice, so please forgive my ignorance. I’ve only been playing with SQL Server 2012 Express for about three weeks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: Helvetica, sans-serif;"&gt;Based on your info, I changed the query to use a simpler boundary file and used Filter() instead of STIntersect(). The view now draws and I can do selections. Though it is still a little slower than the unaltered parcels feature class, it sounds like that’s the best I can hope for when attempting cross-database queries - at least until I learn more about optimization. I'm realizing I need to crawl before I run. The new query is: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas; color: blue;"&gt;CREATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;SPAN style="color: blue;"&gt;VIEW&lt;/SPAN&gt; &lt;SPAN style="color: teal;"&gt;dbo&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: teal;"&gt;parcView&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas; color: blue;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas; color: blue;"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;SPAN style="color: teal;"&gt;parc&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: teal;"&gt;OBJECTID&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: teal;"&gt;parc&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: teal;"&gt;PROP_ID&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: teal;"&gt;parc&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: teal;"&gt;SITE_ADDR&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: teal;"&gt;parc&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: teal;"&gt;SHAPE&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas; color: blue;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;SPAN style="color: teal;"&gt;MASTER_GIS&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: teal;"&gt;dbo&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: teal;"&gt;PARCELS&lt;/SPAN&gt; &lt;SPAN style="color: blue;"&gt;AS&lt;/SPAN&gt; &lt;SPAN style="color: teal;"&gt;parc&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas; color: gray;"&gt;JOIN&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;SPAN style="color: teal;"&gt;dbo&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: teal;"&gt;SIMPLE_BOUNDARY&lt;/SPAN&gt; &lt;SPAN style="color: blue;"&gt;AS&lt;/SPAN&gt; &lt;SPAN style="color: teal;"&gt;bdry&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas; color: blue;"&gt;ON &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas; color: teal;"&gt;parc&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas; color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas; color: teal;"&gt;SHAPE&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas; color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas; color: teal;"&gt;Filter&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas; color: gray;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas; color: teal;"&gt;bdry&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas; color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas; color: teal;"&gt;SHAPE&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas; color: gray;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;SPAN style="color: gray;"&gt;=&lt;/SPAN&gt; 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: Helvetica, sans-serif;"&gt;Here are the stats (or at least some of them, omissions made where my answer is a simple shrug): &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.5pt; font-family: Helvetica, sans-serif;"&gt;How complex the "BOUNDARY" geometry is (number of vertices) &lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin-top: 2.4pt; margin-bottom: 2.4pt;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: Helvetica, sans-serif;"&gt;1607 vertices (the original boundary file had 4125)&lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.5pt; font-family: Helvetica, sans-serif;"&gt;The exact time it takes to query BOUNDARY from a SQL prompt&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin-top: 2.4pt; margin-bottom: 2.4pt;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: Helvetica, sans-serif;"&gt;I put just the SELECT query in a new query in SSMS and the time said 00:00:01&lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.5pt; font-family: Helvetica, sans-serif;"&gt;The exact time it takes to draw the view in ArcMap.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin-top: 2.4pt; margin-bottom: 2.4pt;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: Helvetica, sans-serif;"&gt;I don’t know how to measure this – would love to learn though.&lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.5pt; font-family: Helvetica, sans-serif;"&gt;The spatial index options used on the PARCELS geometry column index&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin-top: 2.4pt; margin-bottom: 2.4pt;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: Helvetica, sans-serif;"&gt;The default spatial index that is added when you import data, I don’t know how to look at the options or alter the index right now. Something I will look into.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-top: 2.4pt; margin-bottom: 2.4pt;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: Helvetica, sans-serif;"&gt;I am very interested in trying the tessellation method. I need to Google about 6000 terms before I even understand what that means, but I’ll get there eventually!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 16:21:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/how-to-optimize-performance-of-db-view-based-on/m-p/868082#M6121</guid>
      <dc:creator>ForrestChevaillier1</dc:creator>
      <dc:date>2016-03-31T16:21:52Z</dc:date>
    </item>
  </channel>
</rss>

