Loading...
Loading...
Use when user needs PostgreSQL database administration, performance optimization, high availability setup, backup/recovery, or advanced PostgreSQL feature implementation.
npx skill4agent add 404kidwiz/claude-supercode-skills postgres-proJSONB Query Pattern Analysis
│
├─ Containment queries (@> operator)?
│ └─ Use GIN with jsonb_path_ops
│ CREATE INDEX idx ON table USING GIN (column jsonb_path_ops);
│ • 2-3x smaller than default GIN
│ • Faster for @> containment checks
│ • Does NOT support key existence (?)
│
├─ Key existence queries (? or ?| or ?& operators)?
│ └─ Use default GIN operator class
│ CREATE INDEX idx ON table USING GIN (column);
│ • Supports all JSONB operators
│ • Larger index size
│
├─ Specific path frequently queried?
│ └─ Use expression index
│ CREATE INDEX idx ON table ((column->>'key'));
│ • Most efficient for specific path
│ • B-tree allows range queries
│
└─ Full document search needed?
└─ Combine GIN + expression indexes
• GIN for flexible queries
• Expression for hot paths| Requirement | Strategy | Configuration |
|---|---|---|
| Read scaling | Streaming (async) | Multiple read replicas |
| Zero data loss | Streaming (sync) | synchronous_commit = on |
| Table-level replication | Logical | CREATE PUBLICATION/SUBSCRIPTION |
| Cross-version upgrade | Logical | Replicate to new version |
| Disaster recovery | Streaming + WAL archive | PITR capability |
| Delayed recovery | Delayed replica | recovery_min_apply_delay |