Simple select count(id) uses 100% of Azure SQL DTUs

前端 未结 3 1892
借酒劲吻你
借酒劲吻你 2020-12-31 06:27

This started off as this question but now seems more appropriately asked specifically since I realised it is a DTU related question.

Basically, running:



        
3条回答
  •  时光说笑
    2020-12-31 06:54

    From the query stats in your previous question we can see:

    300ms CPU time
    8000 physical reads
    

    8:30 is about 500sec. We certainly are not CPU bound. 300ms CPU over 500sec is almost no utilization. We get 16 physical reads per second. That is far below what any physical disk can deliver. Also, the table is not fully cached as evidenced by the presence of physical IO.

    I'd say you are throttled. S1 corresponds to

    934 transactions per minute

    for some definition of transaction. Thats about 15 trans/sec. Maybe you are hitting a limit of one physical IO per transaction?! 15 and 16 are suspiciously similar numbers.

    Test this theory by upgrading the instance to a higher scale factor. You might find that SQL Azure Database cannot deliver the performance you want at an acceptable price.

    You also should find that repeatedly scanning half of the table results in a fast query because the allotted buffer pool seems to fit most of the table (just not all of it).

提交回复
热议问题