Blocking Pattern (Avoid in Production)

CREATE INDEX idx_ledger_status ON payment_ledger (status, created_at);

Zero-Downtime Safe Rewrite

ALTER SESSION SET DDL_LOCK_TIMEOUT = 10;
CREATE INDEX idx_ledger_status ON payment_ledger (status, created_at) ONLINE;

Production Rollout Notes

  • ONLINE builds still acquire brief DML sync locks at the very start and end of execution.
  • Always set DDL_LOCK_TIMEOUT so the sync step waits gracefully instead of raising ORA-00054.