title: How can I specify this SQL Index Hint on my SQL Server 2008 query?
body: <p>I'm not sure where/how I specify this SQL Spatial Index hint on my query :-</p>
  <pre><code>SELECT Whatever
  FROM Table1 a
      INNER JOIN Table2 b ON a.Id = b.Id
  WHERE @SomeBoundingBox.STIntersects(b.SomeGeographyShape) = 1
  </code></pre>
  <p>When I run the query, it's NOT using the Spatial Hint. Yes, I'm using the the latest version SQL Server 2008 r2 (v <a href="http://www.sqlsecurity.com/FAQs/SQLServerVersionDatabase/tabid/63/Default.aspx" rel="nofollow noreferrer">10.5.1600.1</a>).</p>
  <p>So to compare the query speed by forcing the hint, I tried...</p>
  <pre><code>SELECT Whatever
  FROM Table1 a
      INNER JOIN Table2 b WITH (INDEX(MySpatialIndex)) ON a.Id = b.Id
  WHERE @SomeBoundingBox.STIntersects(b.SomeGeographyShape) = 1
  </code></pre>
  <p>and that worked but it was really poor performance.  I was wondering if it was trying to use my hint to do the <code>a.Id = b.Id</code> join (which i don't want to use the hint, for).</p>
  <p>Any suggestions?</p>
  <h3>UPDATE:</h3>
  <p>Added Query Plan. The bulk of the cost is the JOIN between the two tables. The Filter (where clause) takes up the 2nd most costly part.</p>
  <p><img src="https://i.stack.imgur.com/RcQxY.png" alt="alt text" /></p>