SPARK Troubleshooting

Pages Slow to Load

If loading the management or attestation portal pages is slow to load, you will need to see if SQL is being throttled. An issue can occur if you do not have the rb-spark-db-maintenance runbook scheduled. The SQL table can be fragmented which causes the query to utilize more Data I/O causing the query to take longer then normal.

Determine SQL Fragmentation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
SELECT  
    dbschemas.[name] AS schema_name,
    dbtables.[name] AS table_name,
    dbindexes.[name] AS index_name,
    indexstats.avg_fragmentation_in_percent,
    indexstats.page_count
FROM sys.dm_db_index_physical_stats (
        DB_ID(), 
        OBJECT_ID('dbo.spark_site_collection'), 
        NULL, 
        NULL, 
        'SAMPLED'
    ) AS indexstats
INNER JOIN sys.tables dbtables 
    ON dbtables.[object_id] = indexstats.[object_id]
INNER JOIN sys.schemas dbschemas 
    ON dbtables.[schema_id] = dbschemas.[schema_id]
INNER JOIN sys.indexes AS dbindexes 
    ON dbindexes.[object_id] = indexstats.[object_id]
    AND indexstats.index_id = dbindexes.index_id
ORDER BY indexstats.avg_fragmentation_in_percent DESC;

Run the above SQL query to determine the fragmentation of the indexes. If any index is > 15%, it’s recommended to rebuild the index.

1
2
3
ALTER INDEX ALL 
ON dbo.spark_site_collection 
REBUILD;

rb-spark-db-maintenance Runbook

January 2026 introduced a new runbook to help with DB maintenance to ensure the index is not fragmented above 15% in order to ensure queries do not take long to execute.