Link to home
Create AccountLog in
Avatar of bibi92
bibi92Flag for France

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 



Avatar of lcohan
lcohan
Flag of Canada image

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/

Avatar of bibi92

ASKER

Hello


I know that thank you but it takes more 4 hours.

I search another solution


Thank you 

ASKER CERTIFIED SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of bibi92

ASKER

 AzureSQLMaintenance is not Ola hallengren's procedure 

Thank you

Best regards