postgres-patterns
Skill0 starsChanged 22 days agoMITView on GitHub
PostgreSQL schema, query, indexing, and performance patterns.
46 other projects use a version of this.
Adopted by
Most recently taken up by
- Rojios/everything-claude-codetheir own version, first seen Nov 8, 2026
- lhbsaa/apex-unifiedtheir own version, first seen Nov 8, 2026
- ahmadvahidi/skill-atlastheir own version, first seen Nov 8, 2026
- Ashfaqbs/ai-coding-agent-toolkittheir own version, first seen Nov 8, 2026
- Lukk17/agent-standardstheir own version, first seen Nov 7, 2026
- pankaj-mahaur/Agent-Daemontheir own version, first seen Nov 6, 2026
Used with
Projects with it also use content-hash-cache-pattern, configure-ecc and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
royaluniondesign-sysSkillcontent-hash-cache-pattern
Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.
Also in 17 projects that use this
royaluniondesign-sysSkillconfigure-ecc
Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.
Also in 12 projects that use this
junimnjwSkillralphinho-rfc-pipeline
RFC-driven multi-agent DAG execution pattern with quality gates, merge queues, and work unit orchestration.
Also in 12 projects that use this
loulanyueSkillnuxt4-patterns
Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData.
Also in 10 projects that use this
ronmkrSkillvite-patterns
Vite build tool patterns including config, plugins, HMR, env variables, proxy setup, SSR, library mode, dependency pre-bundling, and build optimization. Activate when working with vite.config.ts, Vite plugins, or Vite-based projects.
Also in 8 projects that use this
RojiosSkilldart-flutter-patterns
Production-ready Dart and Flutter patterns covering null safety, immutable state, async composition, widget architecture, popular state management frameworks (BLoC, Riverpod, Provider), GoRouter navigation, Dio networking, Freezed code generation, and clean architecture.
Also in 7 projects that use this
Other versions46 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 46
- ThibautBaissac/rails_ai_agents★ 665same name
- loulanyue/awesome-claude-notes★ 272same name
- tranhieutt/software_development_department★ 71same name
- Fmarzochi/EGC★ 61same name
- skateddu/claude-code-python-setup★ 28same name
- Ashfaqbs/ai-coding-agent-toolkit★ 27same name
- pekral/cursor-rules★ 10same name
- FaisalAlqarni/sp-ecc★ 9same name
- gongyijie85/dsh-ecc★ 8same name
- VoVuongThanhDat/agentflow★ 8same name
36 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository32 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- api-designSkill
- arch-constraint-guardSkill
- backend-patternsSkill
- clean-architectureSkill
- codebase-mappingSkill
- context-budgetSkill
- cqrsSkill
- ddd-architectureSkill
- debug-flowSkill
- dependency-auditSkill
- django-patternsSkill
- django-tddSkill
- event-driven-architectureSkill
- fd-codenavSkill
- fd-mapSkill
- frontend-patternSkill
- git-releaseSkill
- git-workflowSkill
- golang-patternsSkill
- hexagonal-architectureSkill
- java-patternsSkill
- layered-architectureSkill
- performance-profilingSkill
- python-patternsSkill
- refactor-guideSkill
- research-firstSkill
- rust-patternsSkill
- saga-architectureSkill
- security-scanSkill
- tdd-workflowSkill
- test-gap-detectorSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
When designing database schemas, writing complex queries, or optimizing database performance.
- Distinctive: line 13
Design indexes strategically: - Create individual btree indexes on each column for multi-column searches (allows BitmapAnd)
- Distinctive: line 14
Use EXPLAIN ANALYZE: - Always verify query plans before and after optimization
- Distinctive: line 18
Run ANALYZE regularly: - Keep statistics fresh for optimal planner decisions
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
postgres-patterns
When to Activate
When designing database schemas, writing complex queries, or optimizing database performance. Use before creating migrations or writing SQL queries.
Steps
- Design indexes strategically - Create individual btree indexes on each column for multi-column searches (allows BitmapAnd)
- Use EXPLAIN ANALYZE - Always verify query plans before and after optimization
- Choose correct index type - B-tree for equality/range, Bloom for multi-column filters with high selectivity
- Avoid multi-column btree on non-leading columns - Queries on non-first columns of multi-column btree indexes will do sequential scans
- Use parameterized queries - Let the planner cache and reuse query plans
- Run ANALYZE regularly - Keep statistics fresh for optimal planner decisions
Examples
-- AVOID: Multi-column btree for non-leading column queries
CREATE INDEX btreeidx ON tbloom (i1, i2, i3, i4, i5, i6);
-- Query on i2 and i5 will do sequential scan, not use the index
-- PREFER: Individual btree indexes for multi-column searches
CREATE INDEX btreeidx1 ON tbloom (i1);
CREATE INDEX btreeidx2 ON tbloom (i2);
CREATE INDEX btreeidx3 ON tbloom (i3);
CREATE INDEX btreeidx4 ON tbloom (i4);
CREATE INDEX btreeidx5 ON tbloom (i5);
CREATE INDEX btreeidx6 ON tbloom (i6);
-- Bitmap Index Scan with BitmapAnd is used for multi-column queries-- Bloom Index for multi-column filtering (good for low selectivity columns)
CREATE INDEX bloomidx ON tbloom USING bloom (i1, i2, i3, i4, i5, i6);
-- More efficient than btree for queries filtering on many columns
-- Smaller index size, faster Bitmap Index Scans
-- Always verify with EXPLAIN ANALYZE
EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451;-- Query Planner Configuration (temporary fix only)
SET enable_hashjoin = off; -- Force nested-loop or merge join
SET enable_seqscan = off; -- Prefer index scans
SET random_page_cost = 1.1; -- Make index scans cheaper (SSD)
SET effective_cache_size = '8GB'; -- Help planner estimate
-- Better approaches:
-- 1. Run ANALYZE to update statistics
ANALYZE;
-- 2. Increase statistics for specific columns
ALTER TABLE orders SET STATISTICS = 500;
ANALYZE orders;
-- 3. Adjust planner cost constants (postgresql.conf)-- Repository Pattern in SQL
-- Define standard operations
interface OrderRepository {
findAll(filter: OrderFilter, pagination: Pagination): Promise<Order[]>;
findById(id: string): Promise<Order | null>;
create(order: CreateOrderDTO): Promise<Order>;
update(id: string, attributes: UpdateOrderDTO): Promise<Order>;
delete(id: string): Promise<void>;
count(filter?: OrderFilter): Promise<number>;
}Related Skills
- api-design
- backend-patterns
- database-migrations
- postgres-performance
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

