Relational Database Schema Normalization & Indexing Strategy
Design production PostgreSQL schemas with composite indexes, foreign key strategies, and partitioning.
Design high-performance PostgreSQL database schemas with optimized B-tree/GIN indexes, partition strategies, and foreign key integrity.
Execution Workflow Procedure
Ordered steps the coding agent executes when performing this skill.
Analyze Query Access Patterns
Map primary SELECT, JOIN, WHERE, and ORDER BY query patterns along with expected write volumes.
Design Composite & Partial Indexes
Create composite indexes following the Equality-First Range-Second rule, and add partial indexes for filtered queries.
Formulate Table Partitioning Strategy
Design range or hash partitioning for multi-million row tables to facilitate instant data retention drops.
Agent Safety Guardrails & Anti-Hallucination Rules
- DO NOT index low-cardinality boolean columns alone without partial WHERE filters.
- DO NOT create redundant indexes that share the same leftmost prefix.
Expected Output Format
Production DDL migration script with index justifications.
Domain Verification Checks
Example Agent Invocations
Install / Configure This Skill
# Place in .cursorrules or create .cursor/rules/relational-schema-indexing-strategy.mdc # Trigger: Whenever you perform relational database schema normalization & indexing strategy --- name: relational-schema-indexing-strategy description: Design PostgreSQL database schemas, composite B-tree indexes, GIN JSONB indexes, and table partitions. version: 1.0.0 compatibility: [Cursor, Claude Code, Cline, Roo Code, Antigravity] --- # Relational Database Schema Normalization & Indexing Strategy ## Objective Design scalable PostgreSQL relational schemas with optimal indexing and partitioning tailored to access patterns. ## Workflow 1. **Access Pattern Mapping**: Identify critical `WHERE`, `JOIN`, and `ORDER BY` clauses. 2. **Index Optimization**: Apply composite indexes (Equality first, Range second) and partial indexes. 3. **Partitioning**: Implement monthly range partitioning for high-volume time-series datasets.
Need a quick one-time prompt for chat?
Try the Database Schema & Relational Indexing Strategy — a lightweight version designed for 1-click copying directly into Claude, ChatGPT, or Cursor chat.
SprintKit Workflow Integrations
Complementary tools and checklists to pair with this agent workflow.
Related Agent Skills
Explore related procedural workflows in this discipline.
Database Deadlock & Concurrency Race Condition Diagnosis
Diagnose Postgres/MySQL transaction deadlocks, lock contention, and concurrent update race conditions.
API Performance Bottleneck & N+1 Query Optimization
Diagnose slow database queries, serialization bottlenecks, and memory churn in sluggish API endpoints.
Backward-Compatible RESTful API Design & OpenAPI Spec
Design or review RESTful API contracts for idempotency, pagination, error models, and non-breaking versioning.