Skip to content

Instantly share code, notes, and snippets.

@james-s-tayler
Created November 13, 2019 09:31
Show Gist options
  • Save james-s-tayler/98587572e10908fc238cdc1c81264e18 to your computer and use it in GitHub Desktop.
Save james-s-tayler/98587572e10908fc238cdc1c81264e18 to your computer and use it in GitHub Desktop.
SELECT qs.last_logical_reads, st.text, qp.query_plan
FROM sys.dm_exec_query_stats qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) qp
WHERE st.text LIKE '%extent1%' -- Quick and dirty check for a LINQ query
AND qp.dbid = DB_ID('AdventureWorks2012_big')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment