2

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,

1

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.

1
  • maxdop is very good suggestion, I just researched that you can do "vCore-based " scale up from 1 to 2 vCPUs, I will try out maxdop = 1 option after scaling up to 2 vCPUs. Could you advice how to scale up programmatically ? – Aleksey Vitsko Jun 29 '18 at 13:23
2

Have you considered using the Resumable Online Index Rebuild feature so you can schedule X executions of one minute of those indexes?

ALTER INDEX [ix_CustomerIDs]
ON [ContosoSales].[ConstosoTransactionData]
REBUILD
WITH (ONLINE = ON, RESUMABLE = ON, MAX_DURATION = 1 MINUTES);
GO

ALTER INDEX ix_CustomerIDs ON [ContosoSales].[ConstosoTransactionData] PAUSE

ALTER INDEX ix_CustomerIDs ON [ContosoSales].[ConstosoTransactionData] RESUME

Have you considered to scale up the tier to Premium to speed up things when performing index maintenance during any small maintenance window? You will pay Premium for just the hour where you scaled up and users may perceive less performance impact.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.