SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Update Statistics Maint.plan Job


Update Statistics Maint.plan Job

Author
Message
anzz
anzz
SSC-Addicted
SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)

Group: General Forum Members
Points: 481 Visits: 699
In our one PRD server after User DB Reindex job is done Update Statistics job will start

Update Statistics Maint.plan start around: 11:45PM
ending :11:00AM
it is taking almost like 12 hrs to complete the job.

I splited the Update Statistics Maint.plan into two.
like Update Statistics Maint.plan1 and Update Statistics Maint.plan2
which run parallely
Update Statistics Maint.plan1 is taking like 6hrs 28 min 23 sec
Update Statistics Maint.plan2 is taking like 8 hrs 20 min 35 sec.

they are like 32 user databases: total size is 756.0184936523 gigabytes

how to troubleshoot to decrease the time. what does the Update Statistics Maint.plan do ?

Thanks in advance.
Bhuvnesh
Bhuvnesh
SSCertifiable
SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)

Group: General Forum Members
Points: 5422 Visits: 4076
you can divide heavy transactional DB and less transaction Db and set their job accrodingly like for "heavy" DB daily and for "less Db" weekly OR you can choose full scan or sample scan option , it will also reduce the job execution time.
Refer this link for "update statistics " details http://technet.microsoft.com/en-us/library/ms187348%28SQL.90%29.aspx

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
GilaMonster
GilaMonster
SSC Guru
SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)

Group: General Forum Members
Points: 89471 Visits: 45284
Since it's running after an index rebuild, you only need to update column statistics, not index statistics.

Shouldn't be running that long, I've had TB size databases where the stats update takes maybe an hour. Are you hitting IO bottlenecks perhaps?

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

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Bhuvnesh
Bhuvnesh
SSCertifiable
SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)

Group: General Forum Members
Points: 5422 Visits: 4076
GilaMonster (10/14/2010)
Since it's running after an index rebuild, you only need to update column statistics, not index statistics.
Will it get benefit, if we go for first "update statistics" then for "index rebuild/reorganize" ?

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
GilaMonster
GilaMonster
SSC Guru
SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)

Group: General Forum Members
Points: 89471 Visits: 45284
MindOptimizer (10/14/2010)
GilaMonster (10/14/2010)
Since it's running after an index rebuild, you only need to update column statistics, not index statistics.
Will it get benefit, if we go for first "update statistics" then for "index rebuild/reorganize" ?


No.

Either way (before or after) if the update stats does index stats as well as column stats it's wasting time as the rebuild indexes updates index stats.

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

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Bhuvnesh
Bhuvnesh
SSCertifiable
SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)

Group: General Forum Members
Points: 5422 Visits: 4076
GilaMonster (10/14/2010)
MindOptimizer (10/14/2010)
GilaMonster (10/14/2010)
Since it's running after an index rebuild, you only need to update column statistics, not index statistics.
Will it get benefit, if we go for first "update statistics" then for "index rebuild/reorganize" ?


No.

Either way (before or after) if the update stats does index stats as well as column stats it's wasting time as the rebuild indexes updates index stats.
So what sequence we should keep ? first update statistics or index rebuild/reorganize ?

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
GilaMonster
GilaMonster
SSC Guru
SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)

Group: General Forum Members
Points: 89471 Visits: 45284
Well there's no difference which way around providing you don't have the stats update update the index statistics.

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

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


anzz
anzz
SSC-Addicted
SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)

Group: General Forum Members
Points: 481 Visits: 699
In all our PRD servers.
Once the Full Backup finishes, I call the Check DB Integrity job from the Full Backup job.
Then the Check DB Integrity job runs and when it finishes it calls the User DB Reindex job.
The User DB Reindex job will call the Update Statistics job.
So I have one job calling the next job.

Now I have issue with Update Statistics is taking to long to complete
as mentioned in my 1st post.

@GilaMonster: How do I troubleshoot hitting IO bottlenecks?
and is there any other way to troubleshoot Update Statistics.
What does the update Statistics job do internally?

@MindOptimizer: thanks for your replay. But i am doing that by spliting the job and run it parallel.
I want how to know trouble shoot do decrease the time.
Thanks for your replays
GilaMonster
GilaMonster
SSC Guru
SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)

Group: General Forum Members
Points: 89471 Visits: 45284
ravz.sqldba (10/14/2010)
Now I have issue with Update Statistics is taking to long to complete
as mentioned in my 1st post.


Since it's running after the index rebuild, make sure that (if it's a maint plan) you have the selection set for column statistics only, not all.

@GilaMonster: How do I troubleshoot hitting IO bottlenecks?


I suggest you open your favourite search engine and do some reading. It's a large topic.

What does the update Statistics job do internally?

Depends what options you're running it with. In essence, reads part or all of a table, calculates distributions of row values and updates the stored histogram.

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

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


ALZDBA
ALZDBA
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12522 Visits: 8930
The maint plan has the "statistics only" option.

Otherwise you might be using something based on:


select 'UPDATE STATISTICS ' + quotename(object_schema_name(object_id)) + '.' + quotename(object_name(object_id)) + ' ' + quotename(name) + ' with fullscan ;'
from sys.stats
where objectpropertyex(object_id,'IsMSShipped') = 0 -- only select user objects
-- statistics only
and ( auto_created = 1
or user_created = 1 )



Johan


Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere w00t

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


press F1 for solution, press shift+F1 for urgent solution :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search