Skip to content

Instantly share code, notes, and snippets.

@phil-scott-78
Last active April 2, 2019 17:45
Show Gist options
  • Save phil-scott-78/1ae9808cf94288df8ea167c4bff24b21 to your computer and use it in GitHub Desktop.
Save phil-scott-78/1ae9808cf94288df8ea167c4bff24b21 to your computer and use it in GitHub Desktop.
extended event repo
CREATE EVENT SESSION [ShowPlanSpy-7d12bc47-1fe4-47b5-b728-4392b533bc6f] ON SERVER
ADD EVENT sqlserver.query_post_execution_showplan(
ACTION(sqlserver.plan_handle,sqlserver.query_hash,sqlserver.query_plan_hash,sqlserver.sql_text)
WHERE ([sqlserver].[equal_i_sql_unicode_string]([sqlserver].[database_name],N'StackOverflowMath')))
WITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=1 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=OFF,STARTUP_STATE=OFF)
GO
-- run this twice
select top 5 * from users
select top 5 * from posts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment