MP088WARNINGFree

require-analyze-after-backfill

What It Detects

Bulk UPDATE or INSERT ... SELECT with no ANALYZE afterwards leaves the planner working from stale statistics.

Why It's Dangerous

The planner does not look at your data, it looks at pg_statistic — and a backfill can invalidate all of it at once. A column that was entirely NULL before the UPDATE is fully populated afterwards while the statistics still say it is empty, so the planner keeps choosing plans built for a table that no longer exists. Autovacuum fixes this eventually, but it triggers on a row-change threshold rather than on your migration finishing, so latency degrades some time after the deploy went green.

Bad Example

UPDATE users SET status = 'active' WHERE status IS NULL;
-- Migration ends here. Planner still thinks status is entirely NULL.

Good Example

UPDATE users SET status = 'active' WHERE status IS NULL;
ANALYZE users;

Configuration

Disable this rule:

# .migrationpilotrc.yml
rules:
  MP088: false

Or change its severity:

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