Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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.

share|improve this question
1  
What does "use geometry in searching or selecting" mean? Can you add an example? –  Jack Douglas May 24 '11 at 14:48
    
Doppler is all I thought of off-hand. –  Garet Claborn May 24 '11 at 14:55
1  
how about geometric data, like latitude and longitude :) –  Jack Douglas May 24 '11 at 15:04
    
Makes sense, it is a grid-like system so there could be some use in there. ;P I wonder if anyone has used anything like that before –  Garet Claborn May 24 '11 at 15:46
1  
OSM have (though not for the PK) –  Jack Douglas May 24 '11 at 17:27
add comment

1 Answer 1

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?

share|improve this answer
    
Well if you have a table with lots and lots of very precise data about a game map and some effect goes off but you only want to query information that actually 'touches' the effect. Then I wonder if it is ever good or common practice to select row based on deltaX, for instance. –  Garet Claborn Jun 1 '11 at 19:57
    
Unfortunately that sounds more like a physics/game engine issue/solution, of which I'm not familiar with at all. Sorry :-/ –  SQLChicken Jun 28 '11 at 12:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.