Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Inconsistent performance on views Expand / Collapse
Author
Message
Posted Monday, September 24, 2012 8:04 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, September 5, 2014 3:06 PM
Points: 36, Visits: 264
We're running SQL Server 2008 R2 and the views in question are not indexed.

Originally the SELECTs against the views ran less than a second.

But, after a period of time (about 10 days), the performance on the views degrades to 50-60 seconds.

The server is very active and the underlying tables are updated frequently;
so there is some index fragmentation during the week but we we are doing weekly reorgs,
and that doesn't look like the issue.

However, IF we just recreate the view, performance returns to the sub-second range again
- and remains there... until the next time.

Can someone explain what may be happening?
Post #1363502
Posted Monday, September 24, 2012 11:11 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 7:03 AM
Points: 15,738, Visits: 28,146
It sounds like you might be experiencing bad parameter sniffing... possibly. Recreating the view forces a recompile of the plan. If your statistics are aging over the week, but not enough to force a plan recompile, entirely possible, you may see the type of behavior you're seeing. Forcing a scheduled recompile on the plan is one possible solution. You could also try manually updating the statistics.

----------------------------------------------------
"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 #1363638
Posted Monday, September 24, 2012 11:56 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, September 5, 2014 3:06 PM
Points: 36, Visits: 264
Thanks, I'll see if I can hone in on the issue.
Post #1363662
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse