MP021WARNINGAuto-fixableFree
require-concurrent-reindex
What It Detects
REINDEX without CONCURRENTLY acquires ACCESS EXCLUSIVE, blocking all operations.
Why It's Dangerous
REINDEX rebuilds the index while blocking all reads and writes. On PG 12+, REINDEX CONCURRENTLY rebuilds the index without blocking concurrent operations.
Bad Example
REINDEX INDEX idx_users_email;
Good Example
REINDEX INDEX CONCURRENTLY idx_users_email;
Auto-fix
Run migrationpilot analyze file.sql --fix to automatically fix this violation.
Configuration
Disable this rule:
# .migrationpilotrc.yml rules: MP021: false
Or change its severity:
# .migrationpilotrc.yml
rules:
MP021:
severity: warning