DB Ops Sop
OpenDCAI/DataMind
Database operations runbook — backup, recovery, performance tuning, troubleshooting.
Agent skill
by jeremylongshore in jeremylongshore/tons-of-skills-marketplace
Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill analyzing-database-indexes -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace analyzing-database-indexes --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/analyzing-database-indexes .claude/skills/analyzing-database-indexes && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "analyzing-database-indexes" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/analyzing-database-indexes into .claude/skills/analyzing-database-indexes/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "analyzing-database-indexes", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/analyzing-database-indexesType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill analyzing-database-indexes -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace analyzing-database-indexes --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/.curated/analyzing-database-indexes .agents/skills/analyzing-database-indexes && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "analyzing-database-indexes" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/analyzing-database-indexes into .agents/skills/analyzing-database-indexes/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "analyzing-database-indexes", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill analyzing-database-indexes -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace analyzing-database-indexes --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/.curated/analyzing-database-indexes .cursor/skills/analyzing-database-indexes && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "analyzing-database-indexes" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/analyzing-database-indexes into .cursor/skills/analyzing-database-indexes/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "analyzing-database-indexes", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/jeremylongshore/tons-of-skills-marketplace.git --path skills/.curated/analyzing-database-indexes--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill analyzing-database-indexes -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace analyzing-database-indexes --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/.curated/analyzing-database-indexes .gemini/skills/analyzing-database-indexes && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "analyzing-database-indexes" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/analyzing-database-indexes into .gemini/skills/analyzing-database-indexes/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "analyzing-database-indexes", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install jeremylongshore/tons-of-skills-marketplace analyzing-database-indexesInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill analyzing-database-indexes -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/.curated/analyzing-database-indexes .github/skills/analyzing-database-indexes && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "analyzing-database-indexes" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/analyzing-database-indexes into .github/skills/analyzing-database-indexes/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "analyzing-database-indexes", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill analyzing-database-indexes -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace analyzing-database-indexes --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/.curated/analyzing-database-indexes .opencode/skills/analyzing-database-indexes && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "analyzing-database-indexes" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/analyzing-database-indexes into .opencode/skills/analyzing-database-indexes/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "analyzing-database-indexes", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
analyzing-database-indexesProcess use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.
Analyzing Database Indexes is an agent skill from jeremylongshore/tons-of-skills-marketplace. Process use when you need to work with database indexing. This skill provides index design and optimization with comprehensive guidance and automation. Trigger with phrases like "create indexes", "optimize indexes", or "improve query performance".
Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts, reference files and assets (for example `assets/README.md`, `references/README.md` and `scripts/README.md`). Compatibility notes: Designed for Claude Code
It sits in Databases, covering Query optimization. It works with PostgreSQL and MySQL. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.
10 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadWriteEditGrepGlobBash(psql:*)Bash(mysql:*)Bash(mongosh:*)From allowed-tools in the SKILL.md frontmatter.
Ships 2 files in scripts/ (Python), which the agent can run.
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
postgresql.orguse-the-index-luke.comgithub.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Designed for Claude Code
From compatibility in the SKILL.md frontmatter.
Analyzing Database Indexes loads about 2k tokens when it runs, and up to ~2k if it reads all its reference files. Until then it costs about 69 tokens; SKILL.md has 874 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 874 words, ~1,952 tokens.
.claude/skills/analyzing-database-indexes/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.Analyze database index usage, identify missing indexes causing sequential scans, detect redundant or unused indexes wasting write performance, and recommend optimal index configurations for PostgreSQL and MySQL.
pg_stat_user_indexes, pg_stat_user_tables, and pg_stat_statements (PostgreSQL) or performance_schema and sys schema (MySQL)pg_stat_statements extension enabled for PostgreSQL query statisticspsql or mysql CLI for executing analysis queriespg_stat_reset()Identify tables with high sequential scan activity (candidates for missing indexes):
SELECT relname, seq_scan, seq_tup_read, idx_scan, n_live_tup FROM pg_stat_user_tables WHERE seq_scan > 100 AND n_live_tup > 10000 ORDER BY seq_tup_read DESC LIMIT 20seq_scan count and high seq_tup_read relative to n_live_tup is scanning most of the table repeatedlyFind the queries causing sequential scans by correlating with pg_stat_statements:
SELECT query, calls, mean_exec_time, rows FROM pg_stat_statements WHERE query ILIKE '%table_name%' ORDER BY mean_exec_time DESC LIMIT 10EXPLAIN (ANALYZE, BUFFERS) on the top queries to confirm sequential scan usageAnalyze query WHERE clauses and JOIN conditions to determine which columns need indexes. Extract the filtering columns and their selectivity:
SELECT column_name, n_distinct, correlation FROM pg_stats WHERE tablename = 'target_table'n_distinct (close to row count) indicates good index selectivitycorrelation close to 1.0 or -1.0 suggests the column benefits from a B-tree indexRecommend composite indexes for multi-column queries. Follow the equality-first, range-second ordering:
= operators first in the index>, <, BETWEEN, or LIKE 'prefix%' lastWHERE status = 'active' AND created_at > '2024-01-01' -> CREATE INDEX ON orders (status, created_at)Identify unused indexes wasting write performance:
SELECT indexrelname, idx_scan, pg_size_pretty(pg_relation_size(indexrelid)) AS index_size FROM pg_stat_user_indexes WHERE idx_scan = 0 AND indexrelname NOT LIKE '%pkey' ORDER BY pg_relation_size(indexrelid) DESCDetect redundant indexes where one index is a prefix of another:
(customer_id) is redundant if a composite index on (customer_id, created_at) exists, because the composite index serves both single-column and multi-column queriesEvaluate partial indexes for filtered queries. If a query always filters WHERE status = 'active':
CREATE INDEX idx_orders_active ON orders (created_at) WHERE status = 'active'Consider covering indexes (INCLUDE clause in PostgreSQL 11+) for index-only scans:
CREATE INDEX idx_orders_covering ON orders (customer_id, created_at) INCLUDE (total_amount, status)Estimate the impact of each recommendation:
SELECT pg_size_pretty(pg_relation_size('index_name')) for existing similar indexesGenerate a prioritized recommendations report with CREATE INDEX and DROP INDEX statements, estimated storage impact, expected query improvement, and write overhead trade-off analysis.
| Error | Cause | Solution |
|---|---|---|
pg_stat_statements not available | Extension not installed | CREATE EXTENSION pg_stat_statements and add to shared_preload_libraries |
| Index creation blocks writes | CREATE INDEX acquires exclusive lock on the table | Use CREATE INDEX CONCURRENTLY which does not block writes (takes longer but safe for production) |
| Index not used after creation | Statistics not updated or query planner choosing sequential scan | Run ANALYZE table_name; check random_page_cost setting (reduce to 1.1 for SSD); verify query uses indexed columns without functions |
| Statistics reset unexpectedly | pg_stat_reset() called or database restart cleared stats | Wait 24-48 hours for statistics to accumulate; set up periodic stats collection to a metrics table |
| Too many indexes on write-heavy table | Each INSERT/UPDATE must update all indexes | Target 5-7 indexes per table maximum; use composite indexes to replace multiple single-column indexes; remove unused indexes |
Identifying a missing composite index for an API endpoint: The /orders?customer_id=123&status=active endpoint takes 2 seconds. Analysis shows the orders table (5M rows) has indexes on (id) and (customer_id) but not (customer_id, status). The query filters on both columns. Adding CREATE INDEX CONCURRENTLY idx_orders_customer_status ON orders (customer_id, status) reduces the query to 5ms.
Cleaning up 8 unused indexes saving 12GB: Index usage analysis reveals 8 indexes with zero scans over 30 days, totaling 12GB of storage. After confirming none are used for FK enforcement or unique constraints, dropping them reduces write latency by 18% and frees disk space. Command: DROP INDEX CONCURRENTLY idx_name.
Replacing 3 single-column indexes with 1 composite covering index: Table has separate indexes on (user_id), (created_at), and (status). Most queries filter on all three. A single composite index (user_id, status, created_at) INCLUDE (amount) replaces all three, reduces total index storage by 40%, and enables index-only scans for the dashboard query.
© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 4 other files (scripts, references, assets) in skills/.curated/analyzing-database-indexes of jeremylongshore/tons-of-skills-marketplace.
Open the folder on GitHubat commit cfae287
Analyzing Database Indexes next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Analyzing Database Indexes this skilljeremylongshore/tons-of-skills-marketplace | 2.8k | — | ~2k | Automated safety check: Pass | MIT | |
| DB Ops SopOpenDCAI/DataMind | 451 | — | ~388 | Automated safety check: Pass | Apache-2.0 | |
| Altimate Data Warehouse DelegateAltimateAI/data-engineering-skills | 128 | — | ~1.4k | Automated safety check: Pass | MIT | |
| Database OptimizerJeffallan/claude-skills | 12k | — | ~1.6k | Automated safety check: Pass | MIT | |
| SQL ProJeffallan/claude-skills | 12k | — | ~1.3k | Automated safety check: Pass | MIT | |
| Database OptimizerAratKruglik/claude-laravel | 155 | — | ~1k | Automated safety check: Pass | None |
OpenDCAI/DataMind
Database operations runbook — backup, recovery, performance tuning, troubleshooting.
AltimateAI/data-engineering-skills
Delegates dbt and warehouse tasks such as lineage, migrations and cost attribution to the altimate-code CLI agent and relays its answer back.
Jeffallan/claude-skills
Tunes PostgreSQL and MySQL performance by analyzing slow queries and execution plans, designing indexes, rewriting queries and adjusting configuration, one validated change at a time.
Jeffallan/claude-skills
Optimizes SQL queries and designs schemas using CTEs, window functions, covering indexes and EXPLAIN ANALYZE, with notes on dialect differences between major databases.
AratKruglik/claude-laravel
A skill your agent uses when investigating slow queries, analyzing execution plans, or optimizing database performance.
zebbern/claude-code-guide
A skill your agent uses when investigating slow queries, analyzing execution plans, or optimizing database performance.
jeremylongshore/tons-of-skills-marketplace
Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.
jeremylongshore/tons-of-skills-marketplace
Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.
jeremylongshore/tons-of-skills-marketplace
Execute proactive auto-loading: automatically detects and loads agents.md files.
jeremylongshore/tons-of-skills-marketplace
Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.
jeremylongshore/tons-of-skills-marketplace
Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.
jeremylongshore/tons-of-skills-marketplace
Analyze dependencies for known security vulnerabilities and outdated versions.
Works with
Categories
Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace. Analyzing Database Indexes is an agent skill from jeremylongshore/tons-of-skills-marketplace. Process use when you need to work with database indexing.
Analyzing Database Indexes fits situations like: you need to work with database indexing; with phrases like create indexes; optimize indexes; improve query performance.
Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill analyzing-database-indexes -a claude-code`. Or copy the skill folder (skills/.curated/analyzing-database-indexes in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/analyzing-database-indexes in your project. Claude Code loads it when a task matches its description.
Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill analyzing-database-indexes -a codex`. Or copy the skill folder (skills/.curated/analyzing-database-indexes in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/analyzing-database-indexes in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill analyzing-database-indexes -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/analyzing-database-indexes, .gemini/skills/analyzing-database-indexes, .github/skills/analyzing-database-indexes and .opencode/skills/analyzing-database-indexes in your project.
Going by SKILL.md and its folder, Analyzing Database Indexes needs Python for the scripts in its folder. Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Edit, Grep, Glob, Bash(psql:*), Bash(mysql:*), Bash(mongosh:*). Compatibility (from SKILL.md): Designed for Claude Code.
SKILL.md names 3 domains. As links in the text: postgresql.org, use-the-index-luke.com and github.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Analyzing Database Indexes is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 2k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 17 tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Analyzing Database Indexes: DB Ops Sop (OpenDCAI/DataMind, 451 stars), Altimate Data Warehouse Delegate (AltimateAI/data-engineering-skills, 128 stars), Database Optimizer (Jeffallan/claude-skills, 12k stars) and SQL Pro (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.
Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.