Hi Yochanan,
Does the proc update both rowstore and column indexes? when i run the query from microsoft site for column store and rowstore
https://docs.microsoft.com/en-us/sql/relational-databases/indexes/reorganize-and-rebuild-indexes?view=sql-server-ver15
after running your maintenance procedure all the columnstore defrag is cleared. However when i run query for defrag on rowstore index still objects show up. Can you check?
SELECT a.object_id, object_name(a.object_id) AS TableName,
a.index_id, name AS IndedxName, avg_fragmentation_in_percent
FROM sys.dm_db_index_physical_stats
(DB_ID (N'AdventureWorks2016_EXT')
, OBJECT_ID(N'HumanResources.Employee')
, NULL
, NULL
, NULL) AS a
INNER JOIN sys.indexes AS b
ON a.object_id = b.object_id
AND a.index_id = b.index_id;
GO