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

前端 未结 3 1915
借酒劲吻你
借酒劲吻你 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:46

    select count

    should perform clustered index scan if one is available and its up to date. Azure SQL should update statistics automatically, but does not rebuild indexes automatically if they are completely out of date.

    if there's a lot of INSERT/UPDATE/DELETE traffic on that table I suggest manually rebuilding the indexes every once in a while.

    http://blogs.msdn.com/b/dilkushp/archive/2013/07/28/fragmentation-in-sql-azure.aspx

    and SO post for more info

    SQL Azure and Indexes

提交回复
热议问题