ola indexoptimize runs way longer than sql syntax #806
Unanswered
stevetrinhwork
asked this question in
Questions & Answers
Replies: 1 comment
-
Are you able to see what command is running the longest when you run the index maintenance script? The ola script also checks the fragmentation of the table before performing the index maintenance. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working with running some individual indexes using Ola's indexing script and having some timing discrepancy between Ola vs native SQL.
This takes approximately 6 minutes to complete.
Results:
Date and time: 2024-05-20 01:34:11
Server: sqlserver1
Version: 15.0.4360.2
Edition: Enterprise Edition: Core-based Licensing (64-bit)
Platform: Windows
Procedure: [master].[dbo].[IndexOptimize]
Parameters: @databases = 'database1', @FragmentationLow = NULL, @FragmentationMedium = 'INDEX_REORGANIZE,INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE', @FragmentationHigh = 'INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE', @FragmentationLevel1 = 5, @FragmentationLevel2 = 30, @MinNumberOfPages = 1000, @MaxNumberOfPages = NULL, @SortInTempdb = 'Y', @MaxDOP = NULL, @FillFactor = NULL, @PadIndex = NULL, @LOBCompaction = 'Y', @UpdateStatistics = NULL, @OnlyModifiedStatistics = 'N', @StatisticsModificationLevel = NULL, @StatisticsSample = NULL, @StatisticsResample = 'N', @PartitionLevel = 'Y', @MSShippedObjects = 'N', @indexes = 'database1.dbo.table1.index1', @Timelimit = NULL, @delay = NULL, @WaitAtLowPriorityMaxDuration = NULL, @WaitAtLowPriorityAbortAfterWait = NULL, @Resumable = 'N', @AvailabilityGroups = NULL, @LockTimeout = NULL, @LockMessageSeverity = 16, @StringDelimiter = ',', @DatabaseOrder = NULL, @DatabasesInParallel = 'N', @ExecuteAsUser = NULL, @LogToTable = 'N', @execute = 'Y'
Version: 2022-01-02 13:58:13
Source: https://ola.hallengren.com
Date and time: 2024-05-20 01:34:11
Database: [database1]
State: ONLINE
Standby: No
Updateability: READ_WRITE
User access: MULTI_USER
Recovery model: SIMPLE
Is accessible: Yes
Date and time: 2024-05-20 01:40:09
Completion time: 2024-05-20T01:40:09.1072649-07:00
The native SQL command below completes in 6 seconds.
ALTER INDEX index1 ON table1 REBUILD WITH (ONLINE = ON, SORT_IN_TEMPDB = ON)
What am I doing wrong with the Ola commands?
Beta Was this translation helpful? Give feedback.
All reactions