Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
CharlieLima
Starting Member
2 Posts |
Posted - 2010-11-04 : 14:00:03
|
Spatial Index TuningHaving 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...) |
|
X002548
Not Just a Number
15586 Posts |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-11-04 : 15:08:27
|
Brett, look at thisCharlieLima, have you examined the execution plans of the queries in question? |
|
|
CharlieLima
Starting Member
2 Posts |
Posted - 2010-11-04 : 18:46:25
|
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. |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-11-04 : 19:49:34
|
please do |
|
|
|
|
|
|
|