database-patterns

Provide database-pattern guidance for schema design, indexing, query optimization, and migration practices.

9|2|Updated Dec 5, 2025
One-click install
npx skills add https://github.com/Zate/cc-plugins --skill database-patterns-zate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-patterns
Source: https://github.com/Zate/cc-plugins/tree/main/plugins/devloop/skills/database-patterns
Command: npx skills add https://github.com/Zate/cc-plugins --skill database-patterns-zate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Designing and optimizing databases is complex, leading to performance issues, data integrity challenges, and technical debt. This Skill provides proven patterns to build robust, scalable, and efficient data models.

Core Features & Use Cases

  • Schema Design: Apply normalization, denormalization, and naming conventions for clear, maintainable schemas.
  • Indexing Strategies: Optimize query performance with B-tree, Hash, GiST, GIN, Partial, and Covering indexes.
  • Query Optimization: Learn to use EXPLAIN ANALYZE and avoid common anti-patterns for faster queries.
  • Migration Best Practices: Implement safe migration patterns and understand dangerous operations to prevent data loss.
  • Use Case: Design a new user data model for an e-commerce platform, optimize slow-running reports, or plan a database migration with minimal downtime.

Quick Start

Design a database schema for a new e-commerce platform, including tables for users, products, and orders, ensuring proper normalization and indexing.

Frequently Asked Questions about database-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize slow database queries?

Query optimization uses EXPLAIN ANALYZE to identify bottlenecks, then applies indexing strategies like B-tree or covering indexes and eliminates anti-patterns to reduce execution time and improve performance across relational databases.

What's the best way to design a normalized database schema?

Schema design applies normalization levels, naming conventions, and relationship constraints to create maintainable, efficient structures that prevent data redundancy and integrity issues while supporting scalability.

How do I safely migrate a production database with minimal downtime?

Safe migration planning implements proven patterns across development, staging, and production environments, avoiding dangerous operations that risk data loss while maintaining availability and consistency.

What indexing strategies improve database performance?

Indexing strategies use B-tree, Hash, GiST, GIN, Partial, and Covering indexes to accelerate query execution by optimizing data retrieval based on access patterns and query characteristics.

When should I denormalize a database schema?

Denormalization trades normalized structure for query performance in specific scenarios—balancing data integrity concerns against speed requirements requires understanding trade-offs for your workload patterns.

Do I need specific tools to plan database migrations?

Migration best practices are pattern-based and applicable to relational databases using standard tools; the patterns themselves guide safe operations across environments regardless of specific database platform.