Real time progress ofSQL index maintenance job

Arunkumar Janakiraman 1 Reputation point
2020-12-02T13:38:06.41+00:00

Hello,

Is there a query to check the percentage completion of the index maintenance job? Like how we used to check for backup progress % using sys.dm_exec_requests ?

Thanks,
Arun

Developer technologies Transact-SQL
SQL Server Other
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 47,436 Reputation points
    2020-12-02T13:43:34.597+00:00

    Like how we used to check for backup progress % using sys.dm_exec_requests ?

    That DMV also returns the progress for index operations as well, see sys.dm_exec_requests (Transact-SQL) => percent_complete, it includes

    • ALTER INDEX REORGANIZE
    • DBCC INDEXDEFRAG

  2. EchoLiu-MSFT 14,621 Reputation points
    2020-12-03T06:37:22.177+00:00

    Hi @Arunkumar Janakiraman ,

    Starting from SQL Server 2008, there is a DMV view sys.dm_exec_requests. There is a field percent_complete representing the percentage of work done by some commands. This includes index reorganization (ALTER INDEX REORGANIZE), which does not include ALTER INDEX REBUILD, which can be viewed The percentage of index reorganization (ALTER INDEX ORGANIZE) completed. In other words, the progress of index reorganization cannot be obtained before SQL Server 2008.

    There is a similar case for your reference:
    Check progress of alter index reorganize / rebuild

    If you have any question, please feel free to let me know.
    If the response is helpful, please click "Accept Answer" and upvote it.

    Regards
    Echo


    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Hot issues November--What can I do if my transaction log is full?
    Hot issues November--How to convert Profiler trace into a SQL Server table


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.