Query Hash Values, Plan Guides and the Query Store

SQL Server 2016
I was eating dinner with Hugo Kornelis and we started talking about query hash values. You know, like everyone does at dinner. As we talked about it, I suddenly thought about both Plan Guides and the Query Store. I wondered what happened to the query hash values in that case? Thus are blog posts born. Query Hash and Plan Guides The behavior of the query hash itself is fairly straight forward. The text of the query is run through a hashing algorithm within SQL Server and a value comes out, so these two queries: [crayon-5a6d847554d16175667070/] Result in two different query hash values: Unhinted Query Hash 0x7264738ED060F3C1 Hinted Query Hash 0xD763CBB6B860AFF3 Things get interesting if we create a Plan Guide for the first query to make it behave like the second…
Read More