May 2019
Intermediate to advanced
484 pages
11h 23m
English
In the EXECUTE versus sp_executesql section of Chapter 6, Easily Identified T-SQL Anti-Patterns, we discussed how to send ad hoc T-SQL queries to SQL Server in a way that allows for plan reuse (also see the Plan caching and re-use section in Chapter 2, Understanding Query Processing, for the importance of plan reuse). If we are not sure whether or not our application is successfully parameterizing queries and leveraging plan reuse, we can use the query_hash column in sys.dm_exec_query_stats (known as the query fingerprint) to identify queries that are logically equivalent, but have different entries in the cache. Queries that have the same query_hash but different values for the sql_handle column are ...
Read now
Unlock full access