Execution Plans in Azure SQL Database

Yes you can still get execution plans for Azure SQL Database, you cannot get this from the Azure Portal so it is good to know for your tuning days. It is based on the same code you have probably run many times before. Lets get the plan handle and work through an example.

As you can see, I am connected to Azure and issue a query where I want the plan handle.

SELECT @@VERSION

octoberazure

 SELECT top 10 (total_logical_reads/execution_count),
  (total_logical_writes/execution_count),
  (total_physical_reads/execution_count),
  Execution_count, sql_handle, plan_handle
FROM sys.dm_exec_query_stats
ORDER BY (total_logical_reads + total_logical_writes) Desc

planhandles
Pass the handle in.


SELECT *
FROM sys.dm_exec_query_plan (0x05000600717D5F4D50E12720D401000001000000000000000000000000000000000000000000000000000000)

click

Analyse it.

eplans

 

 

2 thoughts on “Execution Plans in Azure SQL Database

  1. Pingback: Dew Drop – November 21, 2019 (#3077) | Morning Dew

  2. Pingback: Azure SQL Database Execution Plans – Curated SQL

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s