BrentOzarULTD / SQL-Server-First-Responder-Kit

sp_Blitz, sp_BlitzCache, sp_BlitzFirst, sp_BlitzIndex, and other SQL Server scripts for health checks and performance tuning.
http://FirstResponderKit.org
Other
3.34k stars 992 forks source link

sp_BlitzCache divide-by-zero error on In-Memory OLTP (Hekaton) plans #815

Closed BrentOzar closed 7 years ago

BrentOzar commented 7 years ago

Do you want to request a feature or report a bug? Bug

What is the current behavior? On 2016 SP1, clear the plan cache, run a single Hekaton query, and then run sp_BlitzCache. You get a divide-by-zero error - probably because total_worker_time, total_elapsed_time, or total_logical_reads is 0 for these in sys.dm_exec_query_stats. (Not sure which.)

**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via http://sqlfiddle.com See attached text file. Requires StackOverflow database to be attached for sample data, and has hard-coded drive paths around line 13.

What is the expected behavior? We should handle the divide-by-zero error. (Will file separate issues for warning about Hekaton inside plans.)

Hekaton Repro.txt

BrentOzar commented 7 years ago

Tested in 2014, 2016.