I am currently working on migrating sqlserver 2008r2 to SQL server 2016.The DBA before me used "IndexOptimize" from https://ola.hallengren.com/downloads.html to create the iIndex solution.
I can see the job is schedlued and run on a monthly basis and logic apply is:
if Fragmentation < 20 then reorganize index
if fragmentation > 40 rebuild index
I am planning on using the Maintenance plans via SSMS in order to reorganize or Rebuild indexes.
How do i find which one has run "reorganize/rebuild", I can see fragmentation for some table are above 66. Am right in thinking that rebuild Index is not taking place?
SQL Server – Get Last Reorganized or Rebuild Index Date
sql-server-2008sql-server-2016
Related Question
- Sql-server – RESOURCE_SEMAPHORE_QUERY_COMPILER waits in Microsoft SQL Server 2008 Enterprise
- Sql-server – Transaction log has grown huge after maintenance plan to rebuild idex
- SQL Server – How to Rebuild Index in System Database
- Sql-server – Index Maintenance Plan
- Powershell – How to Create a SQL Server Maintenance Plan Using Powershell
- Sql-server – Simple Backup Plan Question
Best Answer
As Aaron mentioned in the comment, the indexes with a lot of fragmentation you are seeing probably got skipped due to the index being too small or too big (default for this is no index is too big).
You can search for the below parameters in the sp definition, and check the job to make sure a different value is not being passed through:
Another possibly is that the index is being rebuilt and then re-fragmenting again. This to me would be a sign that constant rebuilds of that index actually aren't a good help.
If you're looking for when\if the index was ever rebuilt, the Ola sp does have the ability to log to a table and the previous DBA hopefully utilized this feature. If so, you can use the below to figure out when the last time an index was rebuilt.