carloscape/octorato/index-creation-concurrently
Claude Code and agent skill by carloscape/octorato
- community
Checking that the SKILL.md file is still in the repository.
Index Creation (CONCURRENTLY)
Install
npx vskill@latest install carloscape/octorato/index-creation-concurrentlySKILL.md
Index Creation (CONCURRENTLY)
What
CREATE INDEX CONCURRENTLY builds an index without holding an exclusive lock on the table. Regular CREATE INDEX blocks all writes (INSERT/UPDATE/DELETE) for the duration of the build. The CONCURRENTLY variant allows writes to continue while the index is being built.
Why
On production tables with active traffic, a regular index build can cause downtime. A 100M-row table might take minutes to index, during which all writes are blocked. CONCURRENTLY eliminates this risk at the cost of a slightly longer build time.
Lock comparison (PG 16 docs: explicit-locking.html)
| Mode | Lock Acquired | Blocks Writes? | Blocks Reads? | |
|---|---|---|---|---|
CREATE INDEX | SHARE | Yes (INSERT/UPDATE/DELETE blocked) | No | |
CREATE INDEX CONCURRENTLY | SHARE UPDATE EXCLUSIVE | No | No |
How
Basic concurrent index
Covering index (INCLUDE)
Important: Cannot run inside a transaction
Index Types We Used
| Type | Purpose | Example | |
|---|---|---|---|
| B-tree (default) | Equality and range queries | WHERE "HospitalId" = 123 | |
| Covering (INCLUDE) | Avoid table lookups for common queries | Index-only scans | |
| Composite | Multi-column lookups | WHERE "Col1" = x AND "Col2" = y |
When to Use
- Any column used in WHERE, JOIN, or ORDER BY clauses
- FK columns (PostgreSQL does NOT auto-create indexes on FK columns)
- High-cardinality columns that filter large result sets
Where We Used It
- ****: Index on
AppointmentInfo.HospitalId(supporting FK) - ****: Index on
AppointmentInfo.ProviderId(supporting FK) - ****: 6 high-value indexes on analytics tables (covering indexes)
- ****: Baseline indexes on DINO_EC tables
References
-- see "Indexing strategy (actual usage)" and Backlog #5 (Advanced indexes)
-- and index decisions
Gotchas
CONCURRENTLYcannot run inside a DO block or explicit transaction- If a concurrent build fails, it leaves an INVALID index -- check with:
``sql SELECT indexrelid::regclass, indisvalid FROM pg_index WHERE NOT indisvalid; ``
IF NOT EXISTSprevents errors on re-run but does NOT rebuild invalid indexes- Concurrent builds take ~2x longer than regular builds (two table scans)
- Building many indexes concurrently at once can impact performance
Category: DDL | Origin: ,
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/index-creation-concurrently/SKILL.md
Popularity
- Repository stars
- 17
- Repository forks
- 7
- 7-day trend score
- 14
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/carloscape/octorato/index-creation-concurrently)