How can i calculate DTU percentage that query consumed? Are there any formulas to combine CPU, Log IO and Data IO into DTU?
Hi @DmytroLenchuk-1118 Thank you for posting your question on Microsoft Q&A.
Doing this at the query level is not trivial because you have to translate absolute values consumed by query (CPU time, log bytes, physical reads) into percentages based on limits for each resource dimension.
To determine the average percentage of DTU/eDTU utilization relative to the DTU/eDTU limit of a database or an elastic pool, use the following formula:
avg_dtu_percent = MAX(avg_cpu_percent, avg_data_io_percent, avg_log_write_percent)
If you want to migrate an existing on-premises or SQL Server virtual machine workload to SQL Database, use the DTU calculator to approximate the number of DTUs needed.
Please let me know if you have additional queries
Query Performance insights shows DTU used by a query if you have Query Store enabled on the database (it is enabled by default).
DTU is calculated based on those 3 elements: CPU, Data IO and Log IO. So above graph tells you if a query has high consumption of DTU and tells you which of 3 DTU components is more impacted by that query.
12 people are following this question.