Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Trace flag 2371


Trace flag 2371

Author
Message
Igor Micev
Igor Micev
SSCarpal Tunnel
SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)

Group: General Forum Members
Points: 4158 Visits: 4843
Hi All

I want to enable trace flag 2371 for update statistics.
The application generates a lot of queries. As enabling the trace flag withdraws recompilation of the queries, is this a good thing?
Share your experiences please.

Thanks
IgorMi


Igor Micev,SQL Server developer at Seavuswww.seavus.com
EdVassie
EdVassie
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3140 Visits: 3815
I had never heard of TF 2371 until seeing your post. From looking at http://blogs.msdn.com/b/saponsqlserver/archive/2011/09/07/changes-to-automatic-update-statistics-in-sql-server-traceflag-2371.aspx it seems to me that TF 2371 would be useful in the following situations:

a) You have some large tables of over 1 million rows
and
b) The indexes relied on by your queries contain columns whose value is time-dependant (in most situations this means dates, but it could be a derived column such as partition number that is dependant on a date value)

Because TF 2371 triggers more frequent statistics updates, it means the queries that use date-dependant indexes are more likely to get the optimum plan.

Some sites do a weekly update of indexes on all tables, partly to overcome the long lag between automatic updates using the standard 20% change figure. For these people TF 2371 could become an alternative to a weekly stats update.

If you do use TF 2371 I suggest you also turn on asynchronous stats update, as this will avoid a query being stalled while the stats update completes. WARNING: Async stats updates causes a memory leak in some old fix levels - check you have the fix for this problem installed.

Original author: SQL Server FineBuild 1-click install and best practice configuration of SQL Server 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005. 1 Dec 2016: now over 39,000 downloads.
Disclaimer: All information provided is a personal opinion that may not match reality.
Quote: "When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist." - Archbishop Hélder Câmara
robert.gerald.taylor
robert.gerald.taylor
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1319 Visits: 1398
Igor Micev (2/26/2013)
I want to enable trace flag 2371 for update statistics.
The application generates a lot of queries. As enabling the trace flag withdraws recompilation of the queries, is this a good thing?
Share your experiences please.

This thread is a year old, but I'm looking into the same thing.

I asked Grant Fritchey in his presentation at SQL Saturday Cleveland last Saturday (2/8/2014) if there was a scenario where you wouldn't use trace flag 2371 and he said "No". He then clarified and said there could be a couple of scenarios, but he generally recommended it. I'm going to push to get this implemented in our environment.

HTH,
Rob
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