TL;DR
I happened upon a feature in SQL Server Management Studio v17.9 which I was not aware of. It looks a bit like the EXPLAIN
found in Oracle, PostgreSQL and MySQL. Where is this feature documented?
How to Turn The Feature On
I was running the following query with the options Include Actual Execution Plan (Ctrl + M) and Include Live Query Statistics turned on:
SELECT sdes.session_id ,sdes.[status] ,sdes.login_name ,sdes.[host_name] ,sder.blocking_session_id ,sdb.name ,sdes.cpu_time ,sdes.logical_reads --optionally: + sdes.reads + sdes.writes ,sdes.last_request_start_time ,sdes.program_name ,sdes.session_id ,sder.request_id ,dest.[text] FROM sys.dm_exec_sessions AS sdes LEFT JOIN sys.dm_exec_connections AS sdec ON sdes.session_id = sdec.session_id JOIN sys.databases AS sdb ON sdes.database_id = sdb.database_id LEFT JOIN sys.dm_exec_requests AS sder ON sdes.session_id = sder.session_id CROSS APPLY sys.dm_exec_sql_text(sdec.most_recent_sql_handle) AS dest WHERE 1=1 AND sdb.name = ''
Outcome
This produced four results tabs:
- Results
- Messages
- Live Query Statistics
- Execution Plan
Special Results Tab
When I switched to the Results tab, I noticed a result set just below the actual results which looks like this:
Observations
If I turn on either the Include Actual Execution Plan (Ctrl + M) option or the Include Live Query Statistics option, then the SQL Server Explain isn't displayed. The "SQL Server Explain" is only displayed if both options are turned on.
Questions
- Can this feature be turned on without having to activate both Include Actual Execution Plan (Ctrl + M) option and the Include Live Query Statistics?
- Where is this neat little feature documented?
Prerequisites
The following components and/or software packages are involved in the scenario:
Server
- Windows Server 2016
- SQL Server 2016 SP1
Client
- Windows 10 Version 1807 (Build 17134)
- SQL Server Management Studio v17.9
- Microsoft SQL Server Management Studio 14.0.17285.0
- Microsoft Analysis Services Client Tools 14.0.1016.283
- Microsoft Data Access Components (MDAC) 10.0.17134.1
- Microsoft MSXML 3.0 6.0
- Microsoft Internet Explorer 9.11.17134.0
- Microsoft .NET Framework 4.0.30319.42000
- Operating System 6.3.17134
SQL Server Management Studio v17.9
- Include Actual Execution Plan (Ctrl + M) turned ON
- Include Live Query Statistics turned ON