AnsweredAssumed Answered

How to optimize performance of db view based on STIntersect?

Question asked by TempletonDemographics on Mar 30, 2016
Latest reply on Mar 31, 2016 by TempletonDemographics

Hello all,

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:

 

USE OTHER_GDB

GO

 

CREATE VIEW dbo.parcelView

AS

SELECT parc.OBJECTID, parc.PROP_ID, parc.SITE_ADDR, parc.SHAPE

FROM MASTER_GIS.dbo.PARCELS AS parc

JOIN dbo.BOUNDARY AS boundary

ON

parc.SHAPE.STIntersects(boundary.SHAPE) = 1

 

My question: Is it possible to accomplish this and end up with usable feature class in ArcMap?

Outcomes