I am trying to work out the most efficient query for getting points within the radius of a given point. The results do not have to be very accurate, so I would prefer speed over accuracy.
We tried using the where clause to compare the distance of points using STDistance, like this (where @point and v.GeoPoint are types of geography):
WHERE v.GeoPoint.STDistance(@point) <= @radius
Also using STIntersects similar to this:
WHERE @point.STBuffer(@radius).STIntersects(v.GeoPoint) = 1
Are any of these queries preferable or is there another feature that I missed?
source share