December 18, 2012 at 7:37 am
Hi all,
I search a lot for this issue but I can't realize what happen.
The case is, randomly (no very often, but last two weeks happend) we experiment problems with performance in one particulary index (dont know if there are more)
We can see the performance issue becuase the query using the index is too slow (the table has 25 millon rows)
The problem solves when we re-create the index, but i dont certally know if this is a problem of index corruption.
For some reason we dont update statics (a month ago was last time)-
We use SQL 2008 sp3
1 - Could this be the reason of the index problem?
2 - Is there any way to check why the query is to slow?
Thanks for any help
greetings from argentina!!
December 18, 2012 at 7:52 am
gheinze (12/18/2012)
Hi all,I search a lot for this issue but I can't realize what happen.
The case is, randomly (no very often, but last two weeks happend) we experiment problems with performance in one particulary index (dont know if there are more)
We can see the performance issue becuase the query using the index is too slow (the table has 25 millon rows)
The problem solves when we re-create the index, but i dont certally know if this is a problem of index corruption.
For some reason we dont update statics (a month ago was last time)-
We use SQL 2008 sp3
1 - Could this be the reason of the index problem?
2 - Is there any way to check why the query is to slow?
Thanks for any help
greetings from argentina!!
Try updating your statistics. That is almost certainly why your performance jumps all over the place.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
December 18, 2012 at 7:53 am
Stale statistics. Almost certainly.
It's not corruption. Corruption doesn't cause performance problems. Corruption causes severity 24 error messages.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 18, 2012 at 8:01 am
thanks !!!
in addition, we never see in logs an error about index damage,
we will try scheduling statics,
btw, how often is recomended statics update?
December 18, 2012 at 8:28 am
abitguru (12/18/2012)
in addition, we never see in logs an error about index damage,
As I said, it's not going to be corruption. (and one does not depend on the error log anyway to identify corruption in a database)
we will try scheduling statics,
btw, how often is recomended statics update?
You mean 'statistics updates'? Often enough that the queries using the statistics get accurate enough information. Yup, that's about all that can be said.
If you can afford to update stats daily, then do so.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 19, 2012 at 3:44 am
if you have too many indexes, the insert and update performance of your application suffers.
You have to find a balance between the indexing needs of the writes and reads that is based on how your application is used.
so you need to Reorganize indexing & update the stats
follow the below link to update the statistics
December 19, 2012 at 4:46 am
thanks all for help me.!!
Yesterday we test UPDATE STATISTICS in our dev server (almost size of production). Now we are planing the best way to do in our production server.
Thanks again and greetings from argentina!
December 19, 2012 at 4:50 am
I used statistics updates as frequently as every hour but for most systems that have some "slow/off time" over night then daily is plenty good enough. What usually ISN'T good enough is just letting auto update to the job. 20% mods can be a VERY long wait during which time significant amounts of queries get some bad plans.
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
December 19, 2012 at 5:09 am
thanks TheSqlGuru for your reply.
We dont use auto update. And is hard to find a "slow/off time" .. you know. We are thinking the best way to schedule to run in spare time.
In our server test takes 14 hours to complete the job. (less resources and almost the same database size)
December 19, 2012 at 5:51 am
abitguru (12/19/2012)
We dont use auto update. And is hard to find a "slow/off time" .. you know. We are thinking the best way to schedule to run in spare time.
If you have auto_update off then you must manually maintain your statistics (all of them). With it on, you can get away with just manually updating stats where the 20% threshold is too high.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 19, 2012 at 8:32 am
abitguru (12/19/2012)
thanks TheSqlGuru for your reply.We dont use auto update. And is hard to find a "slow/off time" .. you know. We are thinking the best way to schedule to run in spare time.
In our server test takes 14 hours to complete the job. (less resources and almost the same database size)
Saludos...
Do you have Maintenance Jobs on your databases? That may fix the root cause of your problem, which like other already explained, it's because staled stats.
Take a look on this link: SQL Server Index and Statistics Maintenance
That's my favorite smart Index solution. It runs weekly and keep Indexes and statistics up to date. I like Ola's solution because it's "smart" means, if the table does not have enough pages or looks ok, the job will skip it and won't touch it.
December 19, 2012 at 11:21 am
GilaMonster (12/19/2012)
abitguru (12/19/2012)
We dont use auto update. And is hard to find a "slow/off time" .. you know. We are thinking the best way to schedule to run in spare time.If you have auto_update off then you must manually maintain your statistics (all of them). With it on, you can get away with just manually updating stats where the 20% threshold is too high.
I concur.
I also wonder WHY you have disabled auto update stats!?!
I recommend Ola.Hallengren.com for all of your maintenance needs, including index/statistics activities.
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply