DB maintenance running longer

Hi,

I have found an unexpected behavior in DB maintenance while checking for critical indexes. It doesn't accept any new connections (login requests) on Orion web console when its checking for critical indexes and very time consuming that took around 70 minutes stating a long running query as below : 

2021-04-08 06:35:53,858 [1] INFO  SolarWinds.Data.DatabaseMaintenance.MaintenanceEngine - Start checking for critical indexes.
2021-04-08 07:52:29,435 [1] WARN  SolarWinds.Orion.Common.SqlHelper - Long Running Query: 
;WITH TablesWithLobs
AS
(
	SELECT DISTINCT
		TAB.object_id AS TabID
	FROM sys.tables AS TAB
	INNER JOIN sys.columns AS COLS
	ON
		COLS.object_id = TAB.object_id
	WHERE
		(COLS.max_length = -1 OR COLS.system_type_id IN (34,35,99))
),
IndexesWithLobs 
AS
(
	SELECT DISTINCT
		IDXCOLS.object_id,
		IDXCOLS.index_id
	FROM sys.index_columns AS IDXCOLS
	INNER JOIN sys.columns AS COLS
	ON
		COLS.object_id = IDXCOLS.object_id AND
		COLS.column_id = IDXCOLS.column_id
	WHERE
		(COLS.max_length = -1 OR COLS.system_type_id IN (34,35,99))
),
ClusteredIndexesWithLobs
AS
(
	SELECT 
		IDX.object_id,
		IDX.index_id
	FROM sys.indexes AS IDX
	INNER JOIN TablesWithLobs AS TABS
	ON
		TABS.TabID = IDX.object_id
	WHERE 
		TABS.TabID = IDX.object_id AND
		IDX.type = 1
),
AllIndexesWithLobs
AS
(
	SELECT object_id, index_id FROM IndexesWithLobs 
	UNION
	SELECT object_id, index_id FROM ClusteredIndexesWithLobs
)
SELECT
	OBJECT_NAME(IDXSTAT.object_id) AS TableName,
	IDX.name AS IndexName,
	IDXSTAT.avg_fragmentation_in_percent AS Fragmentation,
	IDXSTAT.record_count AS Rows,
    CASE WHEN LOBS.object_id IS NULL THEN 0 ELSE 1 END AS ContainLobColumn,
	IDX.type AS IndexType,
	IDX.allow_page_locks AS AllowPageLocks
FROM sys.dm_db_index_physical_stats(DB_ID(), NULL,NULL,NULL,'Sampled') AS IDXSTAT
INNER JOIN sys.indexes AS IDX
ON
	IDX.object_id = IDXSTAT.object_id AND
	IDX.index_id = IDXSTAT.index_id
LEFT JOIN AllIndexesWithLobs AS LOBS
ON
    LOBS.object_id = IDX.object_id AND
    LOBS.index_id = IDX.index_id
WHERE
	IDXSTAT.index_id <> 0	-- no heaps
 Execution time 4595 seconds
2021-04-08 07:52:29,482 [1] WARN  SolarWinds.Data.IndexDefragmentation.IndexDefragmenter - Indexes with fragmentation over 90% found during DB maintenance.

This is happening since couple of days. Let me know if anyone has faced similar kind of issue in latest version.

Thanks in advance.