Introduction: The Myth of Scheduled Weekend Index Rebuilds
Many database administration teams maintain legacy scheduled jobs that run ALTER INDEX ... REBUILD on every index in the database every Saturday or Sunday night.
In modern database engines (Oracle 19c/23c, SQL Server), B-tree indexes automatically manage block splits and leaf node balancing. Rebuilding indexes blindly without diagnostic proof is a wasteful anti-pattern.
4 Reasons Scheduled Index Rebuilds Cause Harm
1. Excessive Redo Log & Archivelog Generation
- The Problem: Rebuilding a 50 GB index writes 50 GB of new redo log entries to the database transaction log.
- The Impact: Fills the Fast Recovery Area (FRA), forces rapid archivelog switching, and risks database hang (
ORA-00257: archiver error).
2. SGA Buffer Cache & Row Cache Thrashing
- The Problem: Index rebuild operations scan massive tablespaces, evicting warm application data blocks from the SGA buffer cache.
- The Impact: Monday morning application traffic experiences severe disk I/O latency while caches re-populate.
3. Increased Risk of Table & Row Locking
- The Problem: Executing standard
ALTER INDEX REBUILDwithout theONLINEclause acquires an exclusive table lock. - The Impact: Blocks ongoing batch processing and web application transactions during the rebuild window.
4. Temporary Disk Space Double Allocation
- The Problem: RMAN and Oracle require sufficient free tablespace storage to hold both the original index and the new index simultaneously during rebuild.
🔍 Check Your Environment Now (Diagnostic CTA)
Run the following diagnostic query in your database to check if your indexes actually suffer from real leaf-block fragmentation or if you are running unnecessary rebuilds:
-- Diagnostic: Check Index Leaf Block Fragmentation & Deleted Leaf Row Ratio
SELECT
i.index_name,
i.table_name,
i.blevel,
i.leaf_blocks,
i.distinct_keys,
ROUND((s.del_lf_rows / GREATEST(s.lf_rows, 1)) * 100, 2) AS pct_deleted_rows
FROM dba_indexes i
JOIN index_stats s ON i.index_name = s.name
WHERE i.owner NOT IN ('SYS', 'SYSTEM')
AND (s.del_lf_rows / GREATEST(s.lf_rows, 1)) > 0.30;
How to Interpret Results:
blevel > 4orpct_deleted_rows > 30%: The index is genuinely fragmented and will benefit from an online rebuild.pct_deleted_rows < 15%: The index is healthy. Rebuilding it will waste I/O and redo log storage.
The Corrected Modern Index Maintenance Procedure
If an index is confirmed to be severely fragmented, rebuild only that specific index using ONLINE mode:
-- Rebuild only fragmented index online with parallel degree
ALTER INDEX SATURN.SFRSTCR_KEY_IDX REBUILD ONLINE PARALLEL 4;
ALTER INDEX SATURN.SFRSTCR_KEY_IDX NOPARALLEL;
Need help auditing index fragmentation across PeopleSoft or Banner database instances? Schedule an Async Database Health Audit.