Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

What would cause a simple query to use tempdb after reindexing until you update statistics a second time?

Posted on 2014-11-10
3
138 Views
Last Modified: 2014-11-17
This is in regards to Microsoft SQL 2012 Enterprise.

Immediately after updating Indexes and statistics (Manually and also using Hallengren's scripts), several fairly simple queries start using tempdb heavily to the point that it severally impacts the entire SQL Servers performance. Avg. Queue depth goes from .25 to 5 in this state on the tempdb disk on a mirror set. The worst running query goes from a 2 second to 120+ second average run time.

In order to correct the problem we have to manually rerun update statistics on one specific table involved in those queries. I can schedule a second update stats to correct the effects, but would rather fix the root issue if I can identify it.

- Auto Update and Create Statistics are ON in the database. Asynch options are OFF
- No other tables seem to have the problem. (Assumption based on query performance and Tempdb usage)
- Indexes show low fragmentation on the table in question.
- After the second run of Update Statistics, the system operates as expected until the next re-indexing.

Does anyone have any recommendations on how to Root cause this? I have been Googling on this for several weeks now.

I'm hoping I have missed something obvious.

Thanks,
0
Comment
Question by:GracoIT
3 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 40433366
I faced this issue before, the resolution was to recompile all the stored procedures, which I have added at the end of my maintenance plan
0
 
LVL 69

Accepted Solution

by:
Scott Pletcher earned 500 total points
ID: 40433387
You don't want to update statistics on an index that has just been rebuilt, as you'll the stats will be based on fewer rows.

If you have a less-active time frame for that table, I suggest doing a full/100% statistics rebuild on that table during that time, and turning off auto-update stats -- but not auto-create stats -- on that table.
0
 

Author Comment

by:GracoIT
ID: 40433621
I'll give these a try individually tonight and test.

Thanks
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question