Posts

Showing posts from March, 2026

SQLDBA - Know the index creation percentage

by passing the  SPID we  will know the index percentage.   DECLARE @SPID INT = 170; ;WITH agg AS (      SELECT SUM(qp.[row_count]) AS [RowsProcessed],             SUM(qp.[estimate_row_count]) AS [TotalRows],             MAX(qp.last_active_time) - MIN(qp.first_active_time) AS [ElapsedMS],             MAX(IIF(qp.[close_time] = 0 AND qp.[first_row_time] > 0,                     [physical_operator_name],                     N'<Transition>')) AS [CurrentStep]      FROM sys.dm_exec_query_profiles qp      WHERE qp.[physical_operator_name] IN (N'Table Scan', N'Clustered Index Scan',                                            N'...