简体   繁体   中英

Azure MS SQL DTU Calculations for the sub query

Is it true that one query is one transaction in Azure SQL DTU? that mean is my basic package has 5 DTU it won't execute more than 5 quires in one second?

I am wondering how much DTU it will take to execute a query where sub query runs 1,000 times.

DTU, abbreviation for Database Throughput Unit, is involved with multiple factors including CPU, Memory, reads and writes. Not just queries per seconds or transactions at a time.

There is a calculator for you to measure your on-premise database, if you want to migrate it to Azure SQL database.

And, there is an test for Azure SQL Database Benchmark with different Service Tier/Performance Level

No, this is not the amount of queries per second.

It is rather a bit of a blackbox calculation based on:

  • Processor
  • % Processor Time
  • Logical Disk - Disk Reads/sec
  • Logical Disk - Disk Writes/sec
  • Database - Log Bytes Flushed/sec

there is however a calculator that helps you defining the correct amount of dtu's you consume on: http://dtucalculator.azurewebsites.net/

As other have already indicated, the DTU does not reflect queries per second. I recommend you enable SQL Azure Query Performance Insight which will allow you to track DTU usage and identify the top DTU consuming queries.

Also, there is no such concept as a 'sub-query' in execution. There is only the 'query'. If your query contains 'sub-queries' they are nothing more than just parts of the 'query' and in the end there is one query being executed. Your query components (sub-queries, scalar or table valued functions, CTEs, 'lateral views' etc etc ) are all just parts of the one query, and there is one query being executed, no matter how many components it has and how often their operators get invoked. Some queries consume more DTUs than other, but the relation between query text complexity and query execution complexity/cost is not straightforward. Please read Understanding how SQL Server executes a query for a deeper discussion on this topic.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM