简体   繁体   English

子查询的Azure MS SQL DTU计算

[英]Azure MS SQL DTU Calculations for the sub query

Is it true that one query is one transaction in Azure SQL DTU? 在Azure SQL DTU中,一个查询就是一个事务,这是真的吗? that mean is my basic package has 5 DTU it won't execute more than 5 quires in one second? 那意味着我的基本软件包有5个DTU,它在一秒钟内不会执行超过5个查询?

I am wondering how much DTU it will take to execute a query where sub query runs 1,000 times. 我想知道执行一个子查询运行1000次的查询需要多少DTU。

DTU, abbreviation for Database Throughput Unit, is involved with multiple factors including CPU, Memory, reads and writes. DTU是数据库吞吐量单位的缩写,它涉及多个因素,包括CPU,内存,读取和写入。 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. 如果要将其迁移到Azure SQL数据库,则有一个计算器供您测量本地数据库。

And, there is an test for Azure SQL Database Benchmark with different Service Tier/Performance Level 并且,针对具有不同服务层/性能级别的Azure SQL数据库基准进行了测试

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/ 但是,有一个计算器可以帮助您定义消耗的dtu的正确数量: http ://dtucalculator.azurewebsites.net/

As other have already indicated, the DTU does not reflect queries per second. 正如其他人已经指出的那样,DTU不会每秒反映查询。 I recommend you enable SQL Azure Query Performance Insight which will allow you to track DTU usage and identify the top DTU consuming queries. 我建议您启用SQL Azure查询性能见解 ,这将使您能够跟踪DTU使用情况并确定消耗DTU最多的查询。

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. 您的查询组件(子查询,标量或表值函数,CTE,“侧面视图”等)都只是一个查询的一部分,并且正在执行一个查询,无论它有多少组件以及有多少次他们的运算符被调用。 Some queries consume more DTUs than other, but the relation between query text complexity and query execution complexity/cost is not straightforward. 一些查询比其他查询消耗更多的DTU,但是查询文本复杂度和查询执行复杂度/成本之间的关系并不直接。 Please read Understanding how SQL Server executes a query for a deeper discussion on this topic. 请阅读了解SQL Server如何执行查询 ,以对该主题进行更深入的讨论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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