Home Forums SQL Server 2008 SQL Server 2008 Performance Tuning Indexing a Geography field and making SQL use the index RE: Indexing a Geography field and making SQL use the index
duncanburtenshaw
Ten Centuries
Points: 1323
More actions
August 22, 2013 at 9:26 am
#1643998
sometimes it's worth putting in a hint to use the spatial index, i.e.
SELECT CASE WHEN (SELECT count(*) FROM table1 WITH (INDEX ([SpatialIndex])) where SHAPE.STIntersects(@center) = 1) > 0
just to ensure that the spatial index is always used.