bibi92
asked on
IndexOptimize takes long time on azure VLDB database
Hello,
Below query from Ola hallengren's procedure IndexOptimize doesn't finish on Azure VLDB database :
SELECT @ParamFragmentationLevel = MAX(avg_fragmentation_in_percent), @ParamPageCount = SUM(page_count) FROM sys.dm_db_index_physical_stats(DB_ID(@ParamDatabaseName), @ParamObjectID, @ParamIndexID, @ParamPartitionNumber, 'LIMITED') WHERE alloc_unit_type_desc = 'IN_ROW_DATA' AND index_level = 0
How to resolve ?
Thank you
Best regards
ASKER
Hello
I know that thank you but it takes more 4 hours.
I search another solution
Thank you
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
AzureSQLMaintenance is not Ola hallengren's procedure
Thank you
Best regards
I would advise to use using AzureSQLMaintenance stored procedure instead which is a custom stored procedure developed by Microsoft’s Yochanan Rachamim from Ola's as noted here https://techcommunity.microsoft.com/t5/azure-database-support-blog/how-to-maintain-azure-sql-indexes-and-statistics/ba-p/368787 as it is suitable for Azure SQL and compatible with its supported features comparing to Ola's code which is best suited for on-prem SQL Servers.
https://www.sqlshack.com/automate-azure-sql-database-indexes-and-statistics-maintenance/