Welcome to MSDN Blogs Sign in | Join | Help

Syndication

News

Legalese: All postings are provided "AS IS" with no warranties, and confer no rights.
Spatial Indexing Part 1: Why a Spatial Index?

Hi Folks,

If you've seen one of my recent spatial talks, you've seen me walk through the basics of how our indexing works.  I'm going to do roughly the same thing here over a series of blog posts, except that I'm (eventually) going to go into a few more details.  We'll start with some basics, and work down to what we actually do.

All spatial databases (that I'm aware of) use the same basic strategy: when presented with a spatial predicate---e.g., and intersection---they work by splitting the predicate into two parts.  These two parts are called the primary filter and the secondary filter.  To a first a proximation, the secondary filter is the original predicate, and the primary filter is some other operator that has three properties:

  1. It may produce false positives---objects may pass the filter that do not satisfy the predicate---but no false negatives.
  2. It doesn't produce too many false positives---if it does it won't be effective. 
  3. It is fast.

To make this concrete, assume I have a database of all of the roads in the United States.  If I want those roads that intersect Madison, Wisconsin, a (poor) primary filter may quickly throw out all of the roads that do not lie within the state of Wisconsin.  There are certainly roads in Wisconsin that do not intersect Madison.  That these pass the primary filter is fine; it's critical however that no roads intersecting Madison are removed by the primary filter.  We can now do the intersection operation on those roads that remain and be guaranteed that our final answer has all of the right results.

Why go to all of this trouble?  First, because the secondary filter---the actual intersection operator---is slow.  If we can eliminate as many calls as possible to this complicated procedure we'll come out ahead.  Second, because we'd actually like to achieve sublinear behavior, and we can't do that if we have to operate on each row of our database.

If you haven't guessed, the link to indexing is that, quite simply, the spatial index is the primary filter.

Cheers,
-Isaac

Next up: A simple spatial indexing scheme.

Published Saturday, November 24, 2007 5:38 AM by isaac

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Spatial Indexing Part 2: A Simple Spatial Indexing Scheme @ Tuesday, November 27, 2007 5:02 PM

Hi Folks, Let's continue with the discussion of spatial indexing form last time . If you already know

Isaac @ MSDN

# Spatial Indexing Part 3: Faster Primary Filtering @ Wednesday, December 05, 2007 8:18 PM

Hi Folks, Last time we talked about a simple primary filter. (See previous installments: 1 , 2 .) We

Isaac @ MSDN

# Picking up on Indexing: Moving Beyond the Simple Grid @ Tuesday, February 05, 2008 6:37 PM

Hi Folks, Well, I never did complete my series of posts describing our indexing scheme. I guess I ought

Isaac @ MSDN

# Picking up on Indexing: Moving Beyond the Simple Grid @ Tuesday, February 05, 2008 7:38 PM

Hi Folks, Well, I never did complete my series of posts describing our indexing scheme. I guess I ought

Noticias externas

# PASSJにでも書いてろって内容だけど...わんくまでやるお! @ Monday, February 11, 2008 1:28 AM

PASSJにでも書いてろって内容だけど...わんくまでやるお!

hogemanのちょっといたい話

# PASSJにでも書いてろって内容だけど...わんくまでやるお! @ Monday, February 11, 2008 1:34 AM

PASSJにでも書いてろって内容だけど...わんくまでやるお!

hogemanのちょっといたい話

Leave a Comment

(required) 
required 
(required) 
Page view tracker