{"id":500,"date":"2013-01-04T07:35:54","date_gmt":"2013-01-04T15:35:54","guid":{"rendered":"http:\/\/3.209.169.194\/blogs\/erin\/?p=500"},"modified":"2018-12-14T09:10:04","modified_gmt":"2018-12-14T17:10:04","slug":"understanding-when-statistics-will-automatically-update","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/","title":{"rendered":"Understanding When Statistics Will Automatically Update"},"content":{"rendered":"<p>During the PASS Summit in November I presented a session on <a title=\"Demystifying Database Statistics\" href=\"http:\/\/www.pass.org\/summit\/2012\/Sessions\/SessionDetails.aspx\">Demystifying Database Statistics<\/a> (if you attended Summit but missed it, you can stream it from here). During the session I went through a demo that showed the automatic update of a statistic. The database had the <b>Auto Update Statistics<\/b> option enabled, and I had added almost 25,000 rows to a table with 121,000 rows. The number of rows added via the bulk import was just over the limit to trigger an auto-update of statistics for the next query, which I showed. I had many people ask why statistics did not update immediately <i>after<\/i> the bulk load of the 25,000 rows completed, so I want to step through the demo that I did at Summit to clarify when an automatic update will occur.<\/p>\n<p><strong>The Setup<\/strong><\/p>\n<p>Start with a copy of the <code>AdventureWorks2012<\/code> database, which you can download from <a title=\"SQL Server databases on Code Plex\" href=\"https:\/\/msftdbprodsamples.codeplex.com\/\" class=\"broken_link\">CodePlex<\/a>. Ensure that the <b>Auto Update Statistics <\/b>option is enabled:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nIF (SELECT COUNT(*) FROM &#x5B;sys].&#x5B;databases] WHERE &#x5B;name] = 'AdventureWorks2012' AND &#x5B;is_auto_create_stats_on] = 0) = 0\r\nBEGIN\r\nALTER DATABASE &#x5B;AdventureWorks2012] SET AUTO_UPDATE_STATISTICS ON\r\nEND;\r\n<\/pre>\n<p>We\u2019re going to use a copy of the <code>Sales.SalesOrderDetail<\/code> table for the demo. After we create the table, we will check to see when statistics last updated. We can use various methods to check statistics date, such as <code><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms174384.aspx\">DBCC SHOW_STATISTICS<\/a><\/code> or <code><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms190330.aspx\">STATS_DATE<\/a><\/code>, but since the release of SP1 for SQL Server 2012, I have exclusively used <code><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/jj553546%28v=sql.105%29.aspx\">sys.dm_db_stats_properties<\/a><\/code> to get this information.<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nUSE &#x5B;AdventureWorks2012];\r\nGO\r\nSELECT *\r\nINTO &#x5B;Sales].&#x5B;TestSalesOrderDetail]\r\nFROM &#x5B;Sales].&#x5B;SalesOrderDetail];\r\nGO\r\nCREATE CLUSTERED INDEX &#x5B;PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID] ON &#x5B;Sales].&#x5B;TestSalesOrderDetail] (&#x5B;SalesOrderID], &#x5B;SalesOrderDetailID]);\r\nGO\r\nCREATE UNIQUE NONCLUSTERED INDEX &#x5B;AK_TestSalesOrderDetail_rowguid] ON &#x5B;Sales].&#x5B;TestSalesOrderDetail] (&#x5B;rowguid]);\r\nGO\r\nCREATE NONCLUSTERED INDEX &#x5B;IX_TestSalesOrderDetail_ProductID] ON &#x5B;Sales].&#x5B;TestSalesOrderDetail] (&#x5B;ProductID]);\r\nGO\r\nSELECT\r\nOBJECT_NAME(&#x5B;sp].&#x5B;object_id]) AS &amp;quot;Table&amp;quot;,\r\n&#x5B;sp].&#x5B;stats_id] AS &amp;quot;Statistic ID&amp;quot;,\r\n&#x5B;s].&#x5B;name] AS &amp;quot;Statistic&amp;quot;,\r\n&#x5B;sp].&#x5B;last_updated] AS &amp;quot;Last Updated&amp;quot;,\r\n&#x5B;sp].&#x5B;rows],\r\n&#x5B;sp].&#x5B;rows_sampled],\r\n&#x5B;sp].&#x5B;unfiltered_rows],\r\n&#x5B;sp].&#x5B;modification_counter] AS &amp;quot;Modifications&amp;quot;\r\nFROM &#x5B;sys].&#x5B;stats] AS &#x5B;s]\r\nOUTER APPLY sys.dm_db_stats_properties (&#x5B;s].&#x5B;object_id],&#x5B;s].&#x5B;stats_id]) AS &#x5B;sp]\r\nWHERE &#x5B;s].&#x5B;object_id] = OBJECT_ID(N'Sales.TestSalesOrderDetail');\r\n<\/pre>\n<p>Here&#8217;s the output:<\/p>\n<figure id=\"attachment_502\" aria-describedby=\"caption-attachment-502\" style=\"width: 1024px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/stats_auto_update_1\/\" rel=\"attachment wp-att-502\"><img fetchpriority=\"high\" decoding=\"async\" class=\"size-large wp-image-502 \" alt=\"sys.dm_db_stats_properties after initially creating the table\" src=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/stats_auto_update_1-1024x82.jpg\" width=\"1024\" height=\"82\" srcset=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/stats_auto_update_1-1024x82.jpg 1024w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/stats_auto_update_1-300x24.jpg 300w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/stats_auto_update_1.jpg 1847w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption id=\"caption-attachment-502\" class=\"wp-caption-text\">sys.dm_db_stats_properties after initially creating the table<\/figcaption><\/figure>\n<p>This is my go-to DMV for statistics because in addition to including the date that statistics were last updated and row information, I also get a count of modifications since the last statistic update. I just created the table, so the Last Updated date is current, and I have not made any changes so the modification count is 0.<\/p>\n<p><strong>Invalidating Statistics<\/strong><\/p>\n<p>For my demo I want to bulk insert enough rows to invalidate the statistics. SQL Server has pre-determined thresholds where it considers statistics to be out-of-date and therefore invalid. The technical article, <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/dd535534(v=sql.100).aspx\">Statistics Used by the Query Optimizer in Microsoft SQL Server 2008<\/a>, documents these thresholds. For a regular table, statistics are out of date when:<\/p>\n<blockquote><p><span style=\"font-family: Times New Roman; font-size: medium;\">o The table size has gone from 0 to &gt;0 rows (test 1).<\/span><\/p>\n<p><span style=\"font-family: Times New Roman; font-size: medium;\">o The number of rows in the table when the statistics were gathered was 500 or less, and the colmodctr of the leading column of the statistics object has changed by more than 500 since then (test 2).<\/span><\/p>\n<p><span style=\"font-family: Times New Roman; font-size: medium;\">o The table had more than 500 rows when the statistics were gathered, and the colmodctr of the leading column of the statistics object has changed by more than 500 + 20% of the number of rows in the table when the statistics were gathered (test 3).<\/span><\/p><\/blockquote>\n<p>The Sales.SalesOrderDetail table has 121317 rows:<\/p>\n<p style=\"padding-left: 30px;\">(121317 * 0.20) + 500 = 24764<\/p>\n<p>The bulk insert below loads 24775 rows, which should be enough to invalidate statistics. Download the .txt file for the bulk insert <a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/sod.zip\">here<\/a>.<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nBULK INSERT AdventureWorks2012.Sales.TestSalesOrderDetail\r\nFROM 'C:\\SQLStuff\\Statistics\\Data\\sod.txt'\r\nWITH\r\n(\r\nDATAFILETYPE = 'native',\r\nTABLOCK\r\n);\r\n(24775 row(s) affected)\r\n<\/pre>\n<p>After the bulk load completes, re-run the query against <code>sys.dm_db_stats_properties<\/code> and review the output:<\/p>\n<figure id=\"attachment_503\" aria-describedby=\"caption-attachment-503\" style=\"width: 1024px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/stats_auto_update_2\/\" rel=\"attachment wp-att-503\"><img decoding=\"async\" class=\"size-large wp-image-503 \" alt=\"sys.dm_db_stats_properties after the bulk import\" src=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/stats_auto_update_2-1024x82.jpg\" width=\"1024\" height=\"82\" srcset=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/stats_auto_update_2-1024x82.jpg 1024w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/stats_auto_update_2-300x24.jpg 300w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/stats_auto_update_2.jpg 1846w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption id=\"caption-attachment-503\" class=\"wp-caption-text\">sys.dm_db_stats_properties after the bulk import<\/figcaption><\/figure>\n<p>The statistics have not updated, but the modification counter has changed, as expected. The statistics are now out of date based on the threshold defined previously, and we would expect that a query or data modification against <code>Sales.TestSalesOrderDetail<\/code> would trigger an update of statistics. But before we try that, let\u2019s review what causes the automatic update.<\/p>\n<p>The aforementioned article states:<\/p>\n<blockquote><p><span style=\"font-family: Times New Roman; font-size: medium;\">The statistics auto update is triggered by query optimization or by execution of a compiled plan, and it involves only a subset of the columns referred to in the query.<\/span><\/p>\n<p><span style=\"font-family: Times New Roman; font-size: medium;\">When a query is first compiled, if the optimizer needs a particular statistics object, and that statistics object exists, the statistics object is updated if it is out of date. When a query is executed and its plan is in the cache, the statistics the plan depends on are checked to see if they are out of date. If so, the plan is removed from the cache, and during recompilation of the query, the statistics are updated. The plan also is removed from the cache if any of the statistics it depends on have changed.<\/span><\/p><\/blockquote>\n<p>To be clear, if a query plan exists in cache and that plan uses specific statistics, when the query executes SQL Server checks to see if any of the statistics used in the plan are out of date. If they are, then the automatic update of those statistics occurs.<\/p>\n<p>If a plan does not exist in cache for a query, then if the optimizer uses a statistics object that is out of date when the plan compiles, SQL Server will automatically update those statistics.<\/p>\n<p><strong>Invoking the Automatic Update<\/strong><\/p>\n<p>We have not run any query against <code>Sales.TestSalesOrderDetail<\/code> except our bulk insert. At the time that the query compiled for the bulk insert, no statistics for Sales.TestSalesOrderDetail were out of date; therefore no statistics required an automatic update.<\/p>\n<p>Now let\u2019s issue an update against <code>Sales.TestSalesOrderDetail<\/code> that will change the <code>ProductID<\/code> for a specific <code>SalesOrderID<\/code>, and then query <code>sys.dm_db_stats_properties<\/code>:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nUPDATE Sales.TestSalesOrderDetail SET ProductID = 717 WHERE SalesOrderID = 75123;\r\nGO\r\n(3 row(s) affected)\r\n<\/pre>\n<p>Output:<\/p>\n<figure id=\"attachment_504\" aria-describedby=\"caption-attachment-504\" style=\"width: 1024px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/stats_auto_update_3\/\" rel=\"attachment wp-att-504\"><img decoding=\"async\" class=\"size-large wp-image-504 \" alt=\"sys.dm_db_stats_properties after the update\" src=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/stats_auto_update_3-1024x82.jpg\" width=\"1024\" height=\"82\" srcset=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/stats_auto_update_3-1024x82.jpg 1024w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/stats_auto_update_3-300x24.jpg 300w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/stats_auto_update_3.jpg 1846w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption id=\"caption-attachment-504\" class=\"wp-caption-text\">sys.dm_db_stats_properties after the update<\/figcaption><\/figure>\n<p>We can see that the <code>PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID<\/code> statistic object automatically updated. We could simply assume that the optimizer used this object in the plan. However, in SQL Server 2012 we can look at the plan XML and confirm this.<\/p>\n<p>In his post, <a href=\"https:\/\/blogfabiano.com\/2012\/07\/03\/statistics-used-in-a-cached-query-plan\/\">Statistics used in a cached query plan<\/a>, Fabiano Neves Amorim describes a method to capture statistics information from the plan. <em>Please<\/em> note the following:<\/p>\n<ul>\n<li>This information is only available in SQL Server 2012 and higher.<\/li>\n<li>This query requires use of an undocumented trace flag. I do not recommend using this trace flag in a Production environment.<\/li>\n<li>This query interrogates the plan cache. The plan cache may be very large for your system, depending on the amount of memory on the server. Before querying the plan, I recommend setting the transaction isolation level to READ UNCOMMITTED, and also recommend using OPTION (MAXDOP 1) to limit CPU utilization. The query may take longer to execute, but it reduces the impact on other queries executing concurrently.<\/li>\n<\/ul>\n<p>If we query the plan cache using Fabio\u2019s query, we get the following information:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nSET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;\r\nGO\r\nDBCC TRACEON (8666);\r\nGO\r\nWITH XMLNAMESPACES ('http:\/\/schemas.microsoft.com\/sqlserver\/2004\/07\/showplan' as p)\r\nSELECT qt.text AS SQLCommand,\r\nqp.query_plan,\r\nStatsUsed.XMLCol.value('@FieldValue','NVarChar(500)') AS StatsName\r\nFROM sys.dm_exec_cached_plans cp\r\nCROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) qp\r\nCROSS APPLY sys.dm_exec_sql_text (cp.plan_handle) qt\r\nCROSS APPLY query_plan.nodes('\/\/p:Field&#x5B;@FieldName=&amp;quot;wszStatName&amp;quot;]') StatsUsed(XMLCol)\r\nWHERE qt.text LIKE '%UPDATE%'\r\nAND qt.text LIKE '%ProductID%';\r\nGO\r\nDBCC TRACEOFF(8666);\r\nGO\r\n<\/pre>\n<p>Output:<\/p>\n<figure id=\"attachment_505\" aria-describedby=\"caption-attachment-505\" style=\"width: 1024px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/stats_auto_update_4\/\" rel=\"attachment wp-att-505\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-505 \" alt=\"statistic object used in the query plan\" src=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/stats_auto_update_4-1024x47.jpg\" width=\"1024\" height=\"47\" srcset=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/stats_auto_update_4-1024x47.jpg 1024w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/stats_auto_update_4-300x14.jpg 300w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/stats_auto_update_4.jpg 1837w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption id=\"caption-attachment-505\" class=\"wp-caption-text\">statistic object used in the query plan<\/figcaption><\/figure>\n<p>The output confirms that the optimizer used the <code>PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID<\/code> statistic object in the query plan, and because it was out of date, SQL Server automatically updated it.<\/p>\n<p>If you are running earlier versions of SQL Server, you can see what statistics the optimizer loads using the undocumented trace flags 9292 and 9204. Paul White has an excellent post, <a href=\"http:\/\/sqlblog.com\/blogs\/paul_white\/archive\/2011\/09\/21\/how-to-find-the-statistics-used-to-compile-an-execution-plan.aspx\" class=\"broken_link\">How to Find the Statistics Used to Compile an Execution Plan<\/a>, which I recommend reading if you\u2019re interested.<\/p>\n<p>One thing I want to point out: the <code>IX_TestSalesOrderDetail_ProductID<\/code> statistic, which has <code>ProductID<\/code> as its key, did not update automatically when the UPDATE query executed. This is expected. Even though the statement modified <code>ProductID<\/code> for three rows (the modification counter for the statistic increased from 24775 to 24778), the optimizer did not use that statistic in the plan. If the plan does not use a statistic, the statistic will not automatically update, even if the query modifies columns in said statistic key.<\/p>\n<p><strong>Summary<\/strong><\/p>\n<p>As I stated initially, I wanted to write this post to clear up any confusion surrounding automatic updates for statistics. Even if a statistic becomes outdated as <i>the result of<\/i> a modification, it will not automatically update <i>after<\/i> the modification completes. The statistic will automatically update the <i>next time<\/i> a query plan uses it.<\/p>\n<p>To reiterate (yes, this might be overkill), SQL Server will automatically update a statistic when:<\/p>\n<ul>\n<li>A query compiles for the first time, and a statistic used in the plan is out of date<\/li>\n<li>A query has an existing query plan, but a statistic in the plan is out of date<\/li>\n<\/ul>\n<p>For those that attended my session at Summit, I hope this helps address any questions you might have still had. If not, please leave a comment and I will get back to you!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>During the PASS Summit in November I presented a session on Demystifying Database Statistics (if you attended Summit but missed it, you can stream it from here). During the session I went through a demo that showed the automatic update of a statistic. The database had the Auto Update Statistics option enabled, and I had [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.9.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Understanding When SQL Server statistics will automatically update<\/title>\n<meta name=\"description\" content=\"This post reviews when SQL Server will automatically update statistics, using the sys.dm_db_stats_properties DMF to track data modifications in SQL Server.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Understanding When SQL Server statistics will automatically update\" \/>\n<meta property=\"og:description\" content=\"This post reviews when SQL Server will automatically update statistics, using the sys.dm_db_stats_properties DMF to track data modifications in SQL Server.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/\" \/>\n<meta property=\"og:site_name\" content=\"Erin Stellato\" \/>\n<meta property=\"article:published_time\" content=\"2013-01-04T15:35:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-12-14T17:10:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/stats_auto_update_1-1024x82.jpg\" \/>\n<meta name=\"author\" content=\"Erin Stellato\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Erin Stellato\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/\",\"name\":\"Understanding When SQL Server statistics will automatically update\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#website\"},\"datePublished\":\"2013-01-04T15:35:54+00:00\",\"dateModified\":\"2018-12-14T17:10:04+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/76170223ffffa1df03fd9be5b66cb158\"},\"description\":\"This post reviews when SQL Server will automatically update statistics, using the sys.dm_db_stats_properties DMF to track data modifications in SQL Server.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Understanding When Statistics Will Automatically Update\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/\",\"name\":\"Erin Stellato\",\"description\":\"The SQL Sequel\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/76170223ffffa1df03fd9be5b66cb158\",\"name\":\"Erin Stellato\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0c8b485bd54ea26b57e99f79b525f409?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0c8b485bd54ea26b57e99f79b525f409?s=96&d=mm&r=g\",\"caption\":\"Erin Stellato\"},\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/erin\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/author\/erin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Understanding When SQL Server statistics will automatically update","description":"This post reviews when SQL Server will automatically update statistics, using the sys.dm_db_stats_properties DMF to track data modifications in SQL Server.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/","og_locale":"en_US","og_type":"article","og_title":"Understanding When SQL Server statistics will automatically update","og_description":"This post reviews when SQL Server will automatically update statistics, using the sys.dm_db_stats_properties DMF to track data modifications in SQL Server.","og_url":"https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/","og_site_name":"Erin Stellato","article_published_time":"2013-01-04T15:35:54+00:00","article_modified_time":"2018-12-14T17:10:04+00:00","og_image":[{"url":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2013\/01\/stats_auto_update_1-1024x82.jpg"}],"author":"Erin Stellato","twitter_misc":{"Written by":"Erin Stellato","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/","url":"https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/","name":"Understanding When SQL Server statistics will automatically update","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#website"},"datePublished":"2013-01-04T15:35:54+00:00","dateModified":"2018-12-14T17:10:04+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/76170223ffffa1df03fd9be5b66cb158"},"description":"This post reviews when SQL Server will automatically update statistics, using the sys.dm_db_stats_properties DMF to track data modifications in SQL Server.","breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/understanding-when-statistics-will-automatically-update\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/erin\/"},{"@type":"ListItem","position":2,"name":"Understanding When Statistics Will Automatically Update"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/erin\/","name":"Erin Stellato","description":"The SQL Sequel","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/erin\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/76170223ffffa1df03fd9be5b66cb158","name":"Erin Stellato","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0c8b485bd54ea26b57e99f79b525f409?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0c8b485bd54ea26b57e99f79b525f409?s=96&d=mm&r=g","caption":"Erin Stellato"},"sameAs":["http:\/\/3.209.169.194\/blogs\/erin"],"url":"https:\/\/www.sqlskills.com\/blogs\/erin\/author\/erin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/posts\/500"}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/comments?post=500"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/posts\/500\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/media?parent=500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/categories?post=500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/tags?post=500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}