PostgreSQL Documentation Reference
2025Emma/vibe-coding-cn
PostgreSQL database documentation - SQL queries, database design, administration, performance tuning, and advanced features. Use when working with PostgreSQL…
SQL 쿼리 최적화 카탈로그. An agent skill from revfactory/harness-100.
$ npx skills add revfactory/harness-100 --skill query-optimization-catalog -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install revfactory/harness-100 query-optimization-catalog --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/revfactory/harness-100.git skills-src && mkdir -p .claude/skills && cp -r skills-src/ko/19-database-architect/.claude/skills/query-optimization-catalog .claude/skills/query-optimization-catalog && 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 "query-optimization-catalog" agent skill from https://github.com/revfactory/harness-100/tree/main/ko/19-database-architect/.claude/skills/query-optimization-catalog into .claude/skills/query-optimization-catalog/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "query-optimization-catalog", 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/revfactory/harness-100/tree/main/ko/19-database-architect/.claude/skills/query-optimization-catalogType 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 revfactory/harness-100 --skill query-optimization-catalog -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install revfactory/harness-100 query-optimization-catalog --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/revfactory/harness-100.git skills-src && mkdir -p .agents/skills && cp -r skills-src/ko/19-database-architect/.claude/skills/query-optimization-catalog .agents/skills/query-optimization-catalog && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "query-optimization-catalog" agent skill from https://github.com/revfactory/harness-100/tree/main/ko/19-database-architect/.claude/skills/query-optimization-catalog into .agents/skills/query-optimization-catalog/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "query-optimization-catalog", 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 revfactory/harness-100 --skill query-optimization-catalog -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install revfactory/harness-100 query-optimization-catalog --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/revfactory/harness-100.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/ko/19-database-architect/.claude/skills/query-optimization-catalog .cursor/skills/query-optimization-catalog && 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 "query-optimization-catalog" agent skill from https://github.com/revfactory/harness-100/tree/main/ko/19-database-architect/.claude/skills/query-optimization-catalog into .cursor/skills/query-optimization-catalog/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "query-optimization-catalog", 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/revfactory/harness-100.git --path ko/19-database-architect/.claude/skills/query-optimization-catalog--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 revfactory/harness-100 --skill query-optimization-catalog -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install revfactory/harness-100 query-optimization-catalog --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/revfactory/harness-100.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/ko/19-database-architect/.claude/skills/query-optimization-catalog .gemini/skills/query-optimization-catalog && 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 "query-optimization-catalog" agent skill from https://github.com/revfactory/harness-100/tree/main/ko/19-database-architect/.claude/skills/query-optimization-catalog into .gemini/skills/query-optimization-catalog/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "query-optimization-catalog", 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 revfactory/harness-100 query-optimization-catalogInstalls 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 revfactory/harness-100 --skill query-optimization-catalog -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/revfactory/harness-100.git skills-src && mkdir -p .github/skills && cp -r skills-src/ko/19-database-architect/.claude/skills/query-optimization-catalog .github/skills/query-optimization-catalog && 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 "query-optimization-catalog" agent skill from https://github.com/revfactory/harness-100/tree/main/ko/19-database-architect/.claude/skills/query-optimization-catalog into .github/skills/query-optimization-catalog/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "query-optimization-catalog", 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 revfactory/harness-100 --skill query-optimization-catalog -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install revfactory/harness-100 query-optimization-catalog --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/revfactory/harness-100.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/ko/19-database-architect/.claude/skills/query-optimization-catalog .opencode/skills/query-optimization-catalog && 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 "query-optimization-catalog" agent skill from https://github.com/revfactory/harness-100/tree/main/ko/19-database-architect/.claude/skills/query-optimization-catalog into .opencode/skills/query-optimization-catalog/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "query-optimization-catalog", 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.
query-optimization-catalogSQL 쿼리 최적화 카탈로그. An agent skill from revfactory/harness-100.
Query Optimization Catalog is an agent skill from revfactory/harness-100. SQL 쿼리 최적화 카탈로그. 인덱스 전략(B-Tree/Hash/GIN/GiST), 실행 계획 분석, N+1 문제 해결, 파티셔닝 전략, 슬로우 쿼리 패턴별 최적화 기법을 제공하는 performance-analyst 확장 스킬. '쿼리 최적화', '인덱스 설계', '실행 계획', 'N+1 문제', '파티셔닝', '슬로우 쿼리' 등 DB 성능 분석 시 사용한다. 단, 데이터 모델링이나 보안 설정은 이 스킬의 범위가 아니다.
Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Databases, covering Query optimization and SQL. It works with SQL and PostgreSQL. The licence is Apache-2.0.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 8e8d35c. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are sql).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From 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.
Query Optimization Catalog loads about 1.3k tokens when it runs. Until then it costs about 66 tokens; SKILL.md has 445 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); files beside SKILL.md are not scanned.
The full file from revfactory/harness-100 at commit 8e8d35c, republished under its Apache-2.0 licence (© revfactory). 445 words, ~1,330 tokens.
.claude/skills/query-optimization-catalog/SKILL.md (or your agent's skills folder).performance-analyst 에이전트가 성능 최적화 시 활용하는 인덱스 전략, 실행 계획 분석, 쿼리 안티패턴 해결 레퍼런스.
performance-analyst — 이 스킬의 최적화 기법을 성능 분석과 인덱스 설계에 직접 적용한다.
| 인덱스 유형 | 적합 쿼리 | DBMS | 특징 |
|---|---|---|---|
| B-Tree | =, <, >, BETWEEN, ORDER BY | 전체 | 범용, 기본값 |
| Hash | = 동등 비교만 | PostgreSQL, MySQL | 범위 검색 불가 |
| GIN | 배열, JSONB, 전문검색 | PostgreSQL | 다중값 인덱싱 |
| GiST | 공간(geometry), 범위 | PostgreSQL | PostGIS, 범위 타입 |
| BRIN | 시계열, 자연 정렬 데이터 | PostgreSQL | 매우 작은 크기 |
| Fulltext | 전문검색 | MySQL, PostgreSQL | LIKE '%word%' 대체 |
INDEX idx_abc ON table(a, b, c)
-- 활용 가능:
WHERE a = 1 -- O (a만)
WHERE a = 1 AND b = 2 -- O (a, b)
WHERE a = 1 AND b = 2 AND c = 3 -- O (전체)
WHERE a = 1 AND c = 3 -- 부분 (a만, c 건너뜀)
-- 활용 불가:
WHERE b = 2 -- X (a 누락)
WHERE c = 3 -- X (a, b 누락)인덱스만으로 쿼리 결과를 반환 (테이블 접근 불필요).
-- 커버링 인덱스
CREATE INDEX idx_covering ON orders(user_id, status, created_at);
-- 이 쿼리는 인덱스만으로 응답 (Index Only Scan)
SELECT status, created_at FROM orders WHERE user_id = 123;| 상황 | 인덱스 추가? | 이유 |
|---|---|---|
| WHERE 절에 자주 사용되는 컬럼 | O | 검색 속도 향상 |
| JOIN ON 절의 FK 컬럼 | O | JOIN 성능 |
| ORDER BY 자주 사용되는 컬럼 | O | 정렬 회피 |
| 매우 낮은 카디널리티 (boolean 등) | X | 효과 미미 |
| 자주 UPDATE되는 컬럼 | 신중히 | 쓰기 성능 저하 |
| 작은 테이블 (1만 행 미만) | X | 풀스캔이 더 빠름 |
-- 안티패턴: 루프에서 개별 쿼리
SELECT * FROM users;
-- 각 user마다:
SELECT * FROM orders WHERE user_id = ?; -- N번 반복!
-- 해결: JOIN 또는 IN
SELECT u.*, o.* FROM users u
LEFT JOIN orders o ON u.id = o.user_id;
-- 또는 배치 로딩
SELECT * FROM orders WHERE user_id IN (1, 2, 3, ...);-- 안티패턴
SELECT * FROM products WHERE category = 'electronics';
-- 해결: 필요한 컬럼만
SELECT id, name, price FROM products WHERE category = 'electronics';
-- 커버링 인덱스 활용 가능-- 안티패턴: 인덱스 컬럼에 함수 적용
WHERE YEAR(created_at) = 2025
-- 해결: 범위 조건으로 변환
WHERE created_at >= '2025-01-01' AND created_at < '2026-01-01'-- 안티패턴
WHERE status = 'active' OR category = 'books'
-- 해결: UNION ALL
SELECT * FROM products WHERE status = 'active'
UNION ALL
SELECT * FROM products WHERE category = 'books' AND status != 'active'-- 안티패턴: 상관 서브쿼리
SELECT * FROM orders o
WHERE o.total > (SELECT AVG(total) FROM orders WHERE user_id = o.user_id);
-- 해결: JOIN + 집계
SELECT o.* FROM orders o
JOIN (SELECT user_id, AVG(total) as avg_total FROM orders GROUP BY user_id) a
ON o.user_id = a.user_id
WHERE o.total > a.avg_total;-- 안티패턴: 깊은 OFFSET
SELECT * FROM products ORDER BY id LIMIT 20 OFFSET 100000;
-- 해결: 커서 기반 (Keyset)
SELECT * FROM products WHERE id > 100000 ORDER BY id LIMIT 20;-- 안티패턴: 수천 개 ID
WHERE id IN (1, 2, 3, ..., 10000)
-- 해결: 임시 테이블 또는 JOIN
-- PostgreSQL: VALUES 또는 ANY(ARRAY[...])
-- 범용: 배치 처리 (500개씩)EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT)
SELECT * FROM orders WHERE user_id = 123 AND status = 'completed';| 노드 | 의미 | 성능 |
|---|---|---|
| Seq Scan | 전체 테이블 스캔 | 느림 (대량 데이터) |
| Index Scan | 인덱스 + 테이블 접근 | 보통 |
| Index Only Scan | 인덱스만으로 응답 | 빠름 |
| Bitmap Index Scan | 비트맵으로 인덱스 스캔 | 보통 |
| Nested Loop | 중첩 루프 조인 | 소량 데이터에 적합 |
| Hash Join | 해시 테이블 조인 | 대량 동등 조인 |
| Merge Join | 정렬 병합 조인 | 대량 정렬 데이터 |
| Sort | 정렬 연산 | 메모리/디스크 주의 |
Seq Scan on 대형 테이블 → 인덱스 필요Sort with external merge Disk → work_mem 부족actual rows >> estimated rows → 통계 오래됨 (ANALYZE 필요)Nested Loop with 대형 테이블 → Hash Join 유도| 유형 | 분할 기준 | 적합 | 예시 |
|---|---|---|---|
| Range | 값 범위 | 시계열 | 월별/연별 파티션 |
| List | 값 목록 | 카테고리 | 지역별, 상태별 |
| Hash | 해시값 | 균등 분산 | user_id % N |
CREATE TABLE events (
id BIGINT,
event_time TIMESTAMPTZ,
data JSONB
) PARTITION BY RANGE (event_time);
CREATE TABLE events_2025_q1 PARTITION OF events
FOR VALUES FROM ('2025-01-01') TO ('2025-04-01');| 레벨 | 도구 | 적합 데이터 | TTL |
|---|---|---|---|
| 쿼리 캐시 | Redis/Memcached | 자주 읽히는 조회 결과 | 30초~5분 |
| ORM 캐시 | Prisma/TypeORM 캐시 | 엔티티 단위 | 1~5분 |
| 집계 캐시 | Materialized View | 통계/대시보드 | 1시간+ |
| CDN 캐시 | CloudFront/CloudFlare | 정적 API 응답 | 5~60분 |
© revfactory, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in ko/19-database-architect/.claude/skills/query-optimization-catalog of revfactory/harness-100.
Open the folder on GitHubat commit 8e8d35c
Query Optimization Catalog 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 |
|---|---|---|---|---|---|---|
| Query Optimization Catalog this skillrevfactory/harness-100 | 1.3k | — | ~1.3k | Automated safety check: Pass | Apache-2.0 | |
| PostgreSQL Documentation Reference2025Emma/vibe-coding-cn | 23k | 1 repos | ~19k | Automated safety check: Pass | MIT | |
| Postgresql Best Practices CloudbaseTencentCloudBase/CloudBase-AI-Toolkit | 1.1k | 1 repos | ~1.3k | Automated safety check: Pass | MIT | |
| SQL ProJeffallan/claude-skills | 12k | — | ~1.3k | Automated safety check: Pass | MIT | |
| SQL Insightzebbern/claude-code-guide | 4.6k | — | ~2.1k | Automated safety check: Pass | MIT | |
| Discover Databaserand/cc-polymath | 181 | — | ~2k | Automated safety check: Pass | MIT |
2025Emma/vibe-coding-cn
PostgreSQL database documentation - SQL queries, database design, administration, performance tuning, and advanced features. Use when working with PostgreSQL…
TencentCloudBase/CloudBase-AI-Toolkit
CloudBase PostgreSQL access-pattern and slow-query quality guidance.
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.
zebbern/claude-code-guide
Translate natural language to SQL, optimize query performance, and interpret EXPLAIN plans for SQLite and PostgreSQL.
rand/cc-polymath
Automatically discover database skills when working with SQL, PostgreSQL, MongoDB, Redis, database schema design, query optimization, migrations, connection pooling, ORMs, or database selection.
github/awesome-copilot
Universal SQL performance optimization assistant for comprehensive query tuning, indexing strategies, and database performance analysis across all SQL databases (MySQL, PostgreSQL, SQL Server…
revfactory/harness-100
A skill for analyzing website anti-bot defense mechanisms and developing legitimate evasion strategies.
revfactory/harness-100
Reference for designing how an API reports failures: structured error codes, response shapes, client-friendly messages, an error catalog and retry or fallback advice.
revfactory/harness-100
Walks a backend-dev agent through OWASP API Top 10 checks, authentication and authorization patterns, and defense code during API design.
revfactory/harness-100
Methodology for systematically designing and generating CLI tool argument parser structures.
revfactory/harness-100
Audience segmentation skill used by the analyst and curator agents.
revfactory/harness-100
Audio storytelling skill used by the podcast scriptwriter and show note editor.
Works with
Categories
SQL 쿼리 최적화 카탈로그. An agent skill from revfactory/harness-100. Query Optimization Catalog is an agent skill from revfactory/harness-100. SQL 쿼리 최적화 카탈로그.
Query Optimization Catalog fits situations like: tasks that involve Query optimization; tasks that involve SQL.
Run `npx skills add revfactory/harness-100 --skill query-optimization-catalog -a claude-code`. Or copy the skill folder (ko/19-database-architect/.claude/skills/query-optimization-catalog in revfactory/harness-100) into .claude/skills/query-optimization-catalog in your project. Claude Code loads it when a task matches its description.
Run `npx skills add revfactory/harness-100 --skill query-optimization-catalog -a codex`. Or copy the skill folder (ko/19-database-architect/.claude/skills/query-optimization-catalog in revfactory/harness-100) into .agents/skills/query-optimization-catalog 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 revfactory/harness-100 --skill query-optimization-catalog -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/query-optimization-catalog, .gemini/skills/query-optimization-catalog, .github/skills/query-optimization-catalog and .opencode/skills/query-optimization-catalog in your project.
SKILL.md names no scripts, command-line tools or credentials: Query Optimization Catalog is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. 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. Review the folder before installing.
Query Optimization Catalog is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.3k tokens (SKILL.md is roughly 5.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Query Optimization Catalog: PostgreSQL Documentation Reference (2025Emma/vibe-coding-cn, 23k stars), Postgresql Best Practices Cloudbase (TencentCloudBase/CloudBase-AI-Toolkit, 1.1k stars), SQL Pro (Jeffallan/claude-skills, 12k stars) and SQL Insight (zebbern/claude-code-guide, 4.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
revfactory (a GitHub user) maintains it in revfactory/harness-100, which has 1,290 GitHub stars. The repository holds 464 skills in this directory. The repository was last updated on March 22, 2026.
Source: revfactory/harness-100 on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.