MP001CRITICALAuto-fixableFree

require-concurrent-index-creation

What It Detects

CREATE INDEX without CONCURRENTLY blocks all writes on the target table for the entire duration of index creation.

Why It's Dangerous

Without CONCURRENTLY, PostgreSQL takes an ACCESS EXCLUSIVE lock on the table, blocking all reads and writes for the entire duration of index creation. On tables with millions of rows, this can mean minutes of complete downtime.

Bad Example

CREATE INDEX idx_users_email ON users (email);

Good Example

CREATE INDEX CONCURRENTLY idx_users_email ON users (email);

Auto-fix

Run migrationpilot analyze file.sql --fix to automatically fix this violation.

Configuration

Disable this rule:

# .migrationpilotrc.yml
rules:
  MP001: false

Or change its severity:

# .migrationpilotrc.yml
rules:
  MP001:
    severity: warning