Community of VE/MapPoint Users and Developers
This is a discussion on Virtual Earth & SQL Server 2008 - Part 2: Spatial Data Management in SQL Server 2008 (3/3) within the Virtual Earth Blogs forums, part of the Blogs category; Spatial Indexing When to use a Spatial Index? Spatial indexes improve significantly the performance of certain type of spatial relationship ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Virtual Earth & SQL Server 2008 - Part 2: Spatial Data Management in SQL Server 2008 (3/3) Spatial IndexingWhen to use a Spatial Index?Spatial indexes improve significantly the performance of certain type of spatial relationship queries but they don’t have an impact on all spatial functions so it is certainly a good idea to choose wisely when and what to index. Geography data types benefit for the following queries from a spatial index:
Geometry data types on the other side can make use of spatial indexes for the following functions:
What exactly is a Spatial Index?The spatial index in SQL Server 2008 is organized as a B-tree index which means the spatial data are represented in the linear order of a B-tree. The number of cells in X- and Y-direction is always the same and can be 4 x 4 for LOW grid density, 8 x 8 for MEDIUM grid density or 16 x 16 for a HIGH grid density. There are 4 indexing levels and a grid density can be set for each individual level. The SQL Server uses a tessellation algorithm to dissect the spatial objects into cells. During this process it uses the following rules:
The tessellation itself works different for geography and geometry data types. Geometries are projected to the “flat-earth” and thus we can further restrict the indexing area by defining the minimum bounding rectangle which is basically an envelope around all our geometries. For geography data types this is not necessary. Here we have a projection from the “round earth” to a flat object as described below. Basically we project the “round earth” on 2 pyramids, flatten these pyramids and then start the tessellation. As a result we have a restriction that a spatial object must be fully located in a single, logical hemisphere. How to Create a Spatial IndexTo create a spatial index we need to have a clustered primary key on a non-spatial column in the database table (such as on an “id” field). The spatial index itself is created with the following SQL-statement for a geometry: CREATE SPATIAL INDEX SI_AddressPoint For a geography the syntax is slightly different and as mentioned above we do not need a BOUNDING_BOX: CREATE SPATIAL INDEX SI_AddressPoint The SQL-statement can also be declared with graphical support through the SQL Server Management Studio. When you are in the design view of a table, right-click on the row for the spatial column and select “Spatial Indexes” from the context menu. You will now find a dialogue which allows you to configure the index. Last edited by Eric Frost; 03-03-2008 at 08:38 AM. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Virtual Earth & SQL Server 2008 - Part 3: Getting Started with Virtual Earth | Johannes Kebeck's Blog | Virtual Earth Blogs | 0 | 03-02-2008 01:40 PM |
| Virtual Earth & SQL Server 2008 - Part 1: Introduction (2/2) | Johannes Kebeck's Blog | Virtual Earth Blogs | 0 | 03-02-2008 07:30 AM |
| Virtual Earth & SQL Server 2008 - Part 1: Introduction (1/2) | Johannes Kebeck's Blog | Virtual Earth Blogs | 0 | 03-02-2008 07:30 AM |
| SQL Server 2008 with Spatial Now Available for Download | VE Team | Virtual Earth Blogs | 1 | 11-20-2007 08:34 AM |
| MapDotNet Server 6.5 Supports SQL Server 2008 and New Virtual Earth Features | VE For Government | Virtual Earth Blogs | 0 | 11-12-2007 05:42 PM |
Menorca Flights
Visit the unspoilt Mediterranean island of Menorca. Menorca flights are low cost flights when you book with Holiday Hypermarket.
City Break Europe
Take a city break in Europe. Travel Counsellors can help plan and book your European city break.
Holiday to Thailand
Want to go somewhere new? Book a low cost holiday to Thailand at dealchecker.co.uk. See the stunning national parks and uninhabited islands.
Cuba Holidays
Cuba holidays offer an exciting cultural and wonderful culinary experience. Book with The Holiday Place for a great deal.
Cheap Cyprus Holidays
Finding cheap Cyprus holidays can be difficult unless you know where to look and where to book. With ulookubook.com you can conduct a simple search to find the latest holiday deals to your particular destination.
Holiday
For the holiday of your life, that is easy to plan, visit Travel.co.uk to see all the options.
Holidays to Lanzarote
Not been to the Canary Islands yet? What are you waiting for! Get information on holidays to Lanzarote at On The Beach.