<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: SQL Spatial: Getting “nearest” calculations working properly	</title>
	<atom:link href="https://lobsterpot.com.au/blog/2014/08/14/sql-spatial-getting-nearest-calculations-working-properly/feed/" rel="self" type="application/rss+xml" />
	<link>https://lobsterpot.com.au/blog/2014/08/14/sql-spatial-getting-nearest-calculations-working-properly/</link>
	<description></description>
	<lastBuildDate>Tue, 08 Dec 2015 21:23:03 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: chris		</title>
		<link>https://lobsterpot.com.au/blog/2014/08/14/sql-spatial-getting-nearest-calculations-working-properly/#comment-2500</link>

		<dc:creator><![CDATA[chris]]></dc:creator>
		<pubDate>Tue, 08 Dec 2015 21:23:03 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=3357#comment-2500</guid>

					<description><![CDATA[hey rob - great post. any suggestions on where to get a list of lat/long for intersections in NYC?]]></description>
			<content:encoded><![CDATA[<p>hey rob &#8211; great post. any suggestions on where to get a list of lat/long for intersections in NYC?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2014/08/14/sql-spatial-getting-nearest-calculations-working-properly/#comment-2499</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Wed, 20 Aug 2014 14:48:29 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=3357#comment-2499</guid>

					<description><![CDATA[Hi Milan! Thanks for responding. We should talk about PDW more too...
Anyway - I think the docs aren&#039;t bad, but the keys are the bits around points 3 and 7, plus the fact that the example doesn&#039;t actually use the indexes on my machine!
So I wouldn&#039;t mind an explicit explanation in the page saying &#034;The query must include an explicit predicate to eliminate the possibility of NULL results which could occur in certain situations even if the columns disallow NULL values. For further information, see the pages regarding STDistance(), etc&#034;
This kind of statement is going to mean that I don&#039;t just dismiss the requirement as needless in my situation.
As for the example not working, a query hint of OPTION (MAXDOP 1) could help.
Of course, as a fan of execution plans, it would be nice to show what people should be looking for as evidence that the index is being used effectively...
...or maybe just provide a link to this post to help people. ;)]]></description>
			<content:encoded><![CDATA[<p>Hi Milan! Thanks for responding. We should talk about PDW more too&#8230;<br />
Anyway &#8211; I think the docs aren&#8217;t bad, but the keys are the bits around points 3 and 7, plus the fact that the example doesn&#8217;t actually use the indexes on my machine!<br />
So I wouldn&#8217;t mind an explicit explanation in the page saying &quot;The query must include an explicit predicate to eliminate the possibility of NULL results which could occur in certain situations even if the columns disallow NULL values. For further information, see the pages regarding STDistance(), etc&quot;<br />
This kind of statement is going to mean that I don&#8217;t just dismiss the requirement as needless in my situation.<br />
As for the example not working, a query hint of OPTION (MAXDOP 1) could help.<br />
Of course, as a fan of execution plans, it would be nice to show what people should be looking for as evidence that the index is being used effectively&#8230;<br />
&#8230;or maybe just provide a link to this post to help people. 😉</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Milan Stojic, SQL Engineer		</title>
		<link>https://lobsterpot.com.au/blog/2014/08/14/sql-spatial-getting-nearest-calculations-working-properly/#comment-2498</link>

		<dc:creator><![CDATA[Milan Stojic, SQL Engineer]]></dc:creator>
		<pubDate>Wed, 20 Aug 2014 10:11:11 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=3357#comment-2498</guid>

					<description><![CDATA[Hi Rob, we tried to make it as intuitive as possible, without trying to explain all constraints and requirements in order to have correct behavior in all cases. 
NULL values in SQL Server are on top with ORDER BY clause and that would ruin your TOP k nearest neighbor results but more importantly would kill performance benefit of using NN query plan. As you mentioned NULLs can be produced by STDistance if the two objects have different SRID. Unfortunately SQL Server does not support ORDER BY NULLS LAST and we don&#039;t keep index on SRID value to know if you are using multiple SRIDs. We would need a table scan to figure it out. That&#039;s why the easiest solution is to require proper query semantic to make sure that NULL values for STDistance are filtered out.
I&#039;d like to hear if there are any suggestions on how to make docs more intuitive.]]></description>
			<content:encoded><![CDATA[<p>Hi Rob, we tried to make it as intuitive as possible, without trying to explain all constraints and requirements in order to have correct behavior in all cases.<br />
NULL values in SQL Server are on top with ORDER BY clause and that would ruin your TOP k nearest neighbor results but more importantly would kill performance benefit of using NN query plan. As you mentioned NULLs can be produced by STDistance if the two objects have different SRID. Unfortunately SQL Server does not support ORDER BY NULLS LAST and we don&#8217;t keep index on SRID value to know if you are using multiple SRIDs. We would need a table scan to figure it out. That&#8217;s why the easiest solution is to require proper query semantic to make sure that NULL values for STDistance are filtered out.<br />
I&#8217;d like to hear if there are any suggestions on how to make docs more intuitive.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
