Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

What is the difference between a spatial index and an attribute index. What are their purposes?

share|improve this question
4  
Please take the time to format your question properly.. –  Petr Krebs Jan 26 '11 at 12:03
    
The poster is asking what is the difference between an attribute index and a spatial index. wt == "what" –  Jordan Parmer Jan 26 '11 at 13:27
4  
@j0rd4n: I got that, I just think it is only polite to make the essential effort to format and formulate a post so that it meets a certain level of quality. –  Petr Krebs Jan 26 '11 at 14:49

2 Answers 2

Spatial Index is used for indexing your geographic data. You can compare it to a Mapbook with a index on page 1, telling what the other pages contain. Assigning a Spatial Index to a layer ensures much better performance than without a Spatial Index - ArcGIS only gets the data you need from the "index pages", that you request.

Attribute Index is assigned to a field in an attribute table and the purpose is also here to enhance the overall performance when querying data.

Hope this simple explaination helps you.

share|improve this answer

Think of your data as a book. If you have a table with millions of records, you can think of it as a book with millions of pages. If you were to find all instances of a given word inside of this book, it would take a very long time. It is the same when searching a database table with many records.

An attribute index functions the same as an index in a book. If you are looking for a particular record, an index helps the database engine find it faster. When a database creates an index, it creates a separate index table which organizes your key fields in an easy to find manner. The index table contains address pointers to where the record can be found in the source table.

A spatial index is the same idea. It makes finding spatial relationships between geometries faster. If you were looking for what polygons intersected another polygon, it wouldn't be very efficient to scan every single vertex for every single polygon in a spatial table.

A spatial index provides metadata for quickly placing spatial data in relationship to other spatial data. A "first order" spatial query will compare the MBR (minimum-bounding-rectangle) of polygons to see if the extent of the polygons even match. If so, a "second order" query will see if the actual vertices interact.

Hope this helps.

share|improve this answer

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.