Are there situations where queries are formed geometrically?

Posted on

Question :

The topic came up in this other question. We were discussing sign value on a primary key having any significance.

If there are good times to use geometry in building queries the sign value could be somewhat useful. Are there any such times?


For instance I could query rows based on a Doppler pattern, increasingly skipping rows as I get further away from the starting point.

Answer :

In response to the latitude/longitude data, relational database systems like SQL Server have spatial data types (http://msdn.microsoft.com/en-us/library/bb933876.aspx) which allows you to handle that kind of stuff. You don’t really need to skip rows or anything crazy like that to satisfy a need to make stuff “look” right, if that makes any sense. What is it that you’re trying to do? Say if rowA is 200 rows away from rowB, then do X?

Leave a Reply

Your email address will not be published. Required fields are marked *