SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Spatial Index tuning
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

CharlieLima
Starting Member

United Kingdom
2 Posts

Posted - 11/04/2010 :  14:00:03  Show Profile  Reply with Quote
Spatial Index Tuning

Having problems with spatial searches which I think is index based. The table has 100k rows and is searched using STDistance based on an indexed geography column. The index is set up as follows:

WITH
(
GRIDS =(LEVEL_1 = MEDIUM,
LEVEL_2 = MEDIUM,
LEVEL_3 = MEDIUM,
LEVEL_4 = MEDIUM),
CELLS_PER_OBJECT = 16,
PAD_INDEX = OFF,
SORT_IN_TEMPDB = OFF,
DROP_EXISTING = OFF,
ALLOW_ROW_LOCKS = ON,
ALLOW_PAGE_LOCKS = ON,
FILLFACTOR = 90
) ON [PRIMARY]

When queries are run in the development environment this works well (quickly and correctly) but when run under load on the live site the databaser server CPU maxes out (not immediately but after some sustained running. Then it goes from 25% to 100% in seconds). (The SP query itself is a pretty straight forward )

The thing that makes me think it's the index is the fact that even at 100% CPU results are returned quickly by simple searches (few matching records) but time out for searches that return many records.

Could the index be improved to prevent the issue, and does anyone have any tips to tune the index? (Or are we barking up the wrong tree...)

Edited by - CharlieLima on 11/04/2010 18:37:10

X002548
Not Just a Number

15586 Posts

Posted - 11/04/2010 :  14:28:42  Show Profile  Reply with Quote
We are talking about SQL Server, correct?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

russell
Pyro-ma-ni-yak

USA
5071 Posts

Posted - 11/04/2010 :  15:08:27  Show Profile  Visit russell's Homepage  Reply with Quote
Brett, look at this

CharlieLima, have you examined the execution plans of the queries in question?

Edited by - russell on 11/04/2010 15:08:46
Go to Top of Page

CharlieLima
Starting Member

United Kingdom
2 Posts

Posted - 11/04/2010 :  18:46:25  Show Profile  Reply with Quote
Brett, we're talking 64-bit SS2008 SP1. The geography column contains points within the UK only.

Russell I've looked at the execution plans but I'm a bit stumped. Especially as the queries are extremely fast when not under load. Can look to post one up if it'll help.
Go to Top of Page

russell
Pyro-ma-ni-yak

USA
5071 Posts

Posted - 11/04/2010 :  19:49:34  Show Profile  Visit russell's Homepage  Reply with Quote
please do
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000