Effective indexing is fundamental to making database applications find the results you want quickly and efficiently. You’re probably already familiar with SQL Server’s clustered and nonclustered indexes, which index one or more columns of data, such as columns of
datetime data. However, SQL Server also includes a type of index specifically designed for indexing spatial data, called (unsurprisingly) a spatial index.
A spatial index can be created only on a column of the
geometry datatype, and columns of these datatypes can only be added to a spatial index; you cannot include a
geography column in a normal nonclustered index, for example.
In this chapter I’ll explain how spatial indexes work, ...