Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 - General
»
Tables Involved in Stored procedure
13 posts, Page 2 of 2
««
1
2
Tables Involved in Stored procedure
Rate Topic
Display Mode
Topic Options
Author
Message
Ed Wagner
Ed Wagner
Posted Thursday, January 24, 2013 7:49 AM
SSCommitted
Group: General Forum Members
Last Login: Thursday, May 16, 2013 6:44 AM
Points: 1,856,
Visits: 528
If nothing changed, then it wouldn't be taking 6 times as long to run. Therefore, something must have changed. It might not be the data in the tables, but there's probably something.
Start by looking at the procedure and examine the execution plans. They'll tell you where your problems lie.
Take the information from there and check your existing indexes. Create new ones where appropriate, but don't believe everything that SQL Server tells you is missing; make sure they make sense and that you don't create duplicates. Overindexing is a real danger you need to avoid.
If you need more information on execution plans, check out Grant Fritchey's book on them. It is very good.
For more information on indexing, this site has an excellent stairway on the topic:
http://www.sqlservercentral.com/stairway/72399/
Tuning is both an art and a science. Many people in this world spend a lot of time doing it and there's a lot to consider. You'll probably come up with the phrase "it depends" a lot. There's also most likely more than one way to fix the problem, but first you have to identify the problem. Don't underestimate the value of trying different approaches on a test server and benchmarking to see your results.
Post #1411144
Grant Fritchey
Grant Fritchey
Posted Thursday, January 24, 2013 8:02 AM
SSChampion
Group: General Forum Members
Last Login: Yesterday @ 4:50 AM
Points: 13,371,
Visits: 25,143
runal_jagtap (1/24/2013)
Update statistics?
Hmm i have never done Update statistics on Database yet..
Please correct my belwo plan..
Sunday no one wotks on the Database
will perfom the below activity..
1) Full Backup - Using manitenencae plan
2) Transaction Log Backup - Using manitenencae plan
3) Truncate Logs (this grows up to GB every day
)
4) Update Statistics & then Rebuild Indexes - Using manitenencae plan
Please suggest
If your database is in FULL recovery and you're only running log backups once a week, you have another issue besides the query.
See this blog post.
As to the query, it does sound like your statistics are stale. Rebuilding the index automatically does a full scan on the statistics for that index. So, be sure you don't update the statistics after a rebuild because that leads to problems.
----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #1411157
Grant Fritchey
Grant Fritchey
Posted Thursday, January 24, 2013 8:09 AM
SSChampion
Group: General Forum Members
Last Login: Yesterday @ 4:50 AM
Points: 13,371,
Visits: 25,143
MasterDB (1/24/2013)
Check the fragmentation of all indexes by using sys.dm_index_usage_physical_stats.
If the fragmentation is more than 35% --Rebuild all the indices.
Ask the users about any change of code..? If so, Check for missing indices by using sys.dm_missing_index_details.
or else, save the SP to .sql file and open DTA(Database Tuning Advisor) and load this .sql file under workload option select your database from the list which shows below and click on Start Analysis, If you got the recommendations more than 65% apply all the recommendations provided SQL Server.
Thanks,
But, only rebuild the indexes if they're more than a single extent in size, otherwise you get no benefit from the defrag at all.
----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #1411159
« Prev Topic
|
Next Topic »
13 posts, Page 2 of 2
««
1
2
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.