In the last SQLskills Insider demo video I went through a scenario where you can use the query_hash column from sys.dm_exec_query_stats to aggregate statistics for queries that only differ by literal values. <\/p>\n
I received an interesting question from someone who watched the video, ran the demo query in production and saw a 0x0000000000000000 value as the highest consumer of worker time (and also had the highest execution count).<\/p>\n
I asked this person to show me the query text where [query_hash] = 0x0000000000000000 and it ended up being a series of FETCH NEXT and FETCH API_CURSOR calls, for example:<\/p>\n
\nFETCH API_CURSOR00000000072ADF22
FETCH API_CURSOR00000000072A0B6E
FETCH API_CURSOR000000000729B7B2
FETCH API_CURSOR000000000729030C
FETCH API_CURSOR000000000729030C<\/p>\n<\/blockquote>\nThere may be other circumstances where 0x0000000000000000 may manifest \u2013 but I haven\u2019t witnessed them or heard of them. If you have non-cursor scenarios where 0x0000000000000000 occurs, please share in the comments.<\/p>\n
Thanks!<\/p>\n","protected":false},"excerpt":{"rendered":"
In the last SQLskills Insider demo video I went through a scenario where you can use the query_hash column from sys.dm_exec_query_stats to aggregate statistics for queries that only differ by literal values. I received an interesting question from someone who watched the video, ran the demo query in production and saw a 0x0000000000000000 value as […]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-1068","post","type-post","status-publish","format-standard","hentry","category-performance"],"yoast_head":"\n
Workloads that generate the 0x0000000000000000 query hash value? - Joe Sack<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n