Azure SQL Database – How to Limit DTU Percentage Consumption for a Session?

azureazure-sql-databasefragmentationnonclustered-index

We have an Azure SQL Database tier S4 (200 DTU), and there is one big table inside
When I run a "alter index rebuild…" statement, it takes about 18 mins to complete

This particular nonclustered index is 5 Gb in size, and during those 18 minutes of rebuilding, it takes all 100% of DTU available to this database
Of course, this is impacting other applications that are trying to work with this database

Question:

How can we limit available resources for a given session that runs a rebuild ?
Say, we want to make it use only 50%-60% of Database's DTUs, but not 100%

Is this possible on Azure SQL Database ?

Regards,

Best Answer

You just thought of a great enhancement request. Sort of an OPTION(MAXDTU 5000) sort of deal.

Not there now. Best bet would either be to scale up for the operation you need programmatically or try and limit the MAXDOP for that operation either an OPTION (MAXDOP 1) hint. The index operation will run longer in serial but likely consume less DTUs.