You may have\u00a0read the blog posts a few weeks ago regarding indexed views and MERGE statement\u00a0usage and incorrect results. If not, please see the following blog posts:<\/p>\n
I won’t rehash what they have collectively\u00a0already covered thoroughly – but just a quick tip about identifying index view and MERGE\u00a0optimization activity\u00a0via the sys.dm_exec_query_optimizer_info DMV…\u00a0 The following query shows counter\u00a0name\u00a0and\u00a0occurrences of optimizations for MERGE statements and indexed views having been matched\u00a0since the SQL Server instance last restarted:<\/p>\n
\r\nSELECT\u00a0 [counter],\r\n[occurrence]\r\nFROM sys.[dm_exec_query_optimizer_info]\r\nWHERE counter IN\r\n('merge stmt',\r\n'indexed views matched');\r\n<\/pre>\nI see this as a “first cut” check – but there are some key limitations to why this would only be a starting data point and not the “end all, be all” approach:<\/p>\n
Even with the limitations, if you see non-zero values for the counters, this might accelerate your investigation and application of the appropriate cumulative update<\/a>.\u00a0 I prefer keeping up with serious issues in this case, but if you need to prioritize what gets patched in larger environments with thousands of SQL Server instances, this may help drive that prioritization.<\/p>\n","protected":false},"excerpt":{"rendered":" You may have\u00a0read the blog posts a few weeks ago regarding indexed views and MERGE statement\u00a0usage and incorrect results. If not, please see the following blog posts: If you are using indexed views and MERGE, please read this! (blog | @AaronBertrand) NOEXPAND query hint returns wrong results \u2013 CU fix now available (blog | @jamiet) […]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,34],"tags":[],"class_list":["post-945","post","type-post","status-publish","format-standard","hentry","category-indexing","category-t-sql"],"yoast_head":"\n