Paths Subjects Questions Quizzes Pricing Search
Intermediate Open Free

Why the Migration Used CREATE INDEX CONCURRENTLY

The covering-index migration for the pagination fix used CREATE INDEX CONCURRENTLY instead of a plain CREATE INDEX.

Why did that matter for this specific table?

Solution

The correct answer is "A plain CREATE INDEX would lock the table against writes."

CLAUDE.md's style notes mention the table is written to continuously, so a plain CREATE INDEX would hold a lock that blocks writes for the duration of the build — its own outage waiting to happen on a table this active. CREATE INDEX CONCURRENTLY avoids that lock, and Claude includes it unprompted because CLAUDE.md already told it this table sees continuous writes.

The distractors invent constraints that don't apply: CONCURRENTLY isn't required syntax for composite indexes in general, it doesn't make an index auto-update as the schema evolves, and it has nothing to do with the PreToolUse hook, which only guards the generated Prisma directory, not migrations.

Share this question

← Back to Case Study: Shipping a Fix with Claude Code, End to End practice

We use cookies for product analytics to improve OmniAtlas. See our Privacy Policy.