database-review

Analyze database schemas, queries, migrations, and indexes for correctness and performance.

7|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/camilooscargbaptista/cto-toolkit --skill database-review-camilooscargbaptista
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-review
Source: https://github.com/camilooscargbaptista/cto-toolkit/tree/main/database-review
Command: npx skills add https://github.com/camilooscargbaptista/cto-toolkit --skill database-review-camilooscargbaptista

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill helps engineering teams identify schema design flaws, unsafe migrations, slow queries, and indexing gaps that cause production outages, slow page loads, and data integrity issues.

Core Features & Use Cases

  • Schema & data modeling review: recommendations for primary keys, data types, normalization, and when to denormalize safely.
  • Migration safety & patterns: multi-step migration plans, rollback strategies, and guidance for non-blocking index creation.
  • Query optimization & indexing: EXPLAIN analysis, index design (composite, partial, GIN/BRIN), and N+1 detection and remediation.
  • Operational guidance: connection pool sizing, vacuum/maintenance checks, and production monitoring queries for pg_stat_statements.
  • Use case: review a legacy Postgres schema, produce a safe migration plan to add a NOT NULL column, and recommend indexes to fix slow reports.

Quick Start

Ask the skill to audit your database schema, analyze slow queries and EXPLAIN output, and return prioritized fixes and safe migration steps.

Frequently Asked Questions about database-review

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

FAQPage Schema
How do I analyze slow queries and EXPLAIN output in PostgreSQL?

Interpreting PostgreSQL EXPLAIN outputs identifies execution bottlenecks and guides the design of composite or partial indexes. This query optimization review yields actionable recommendations that resolve N+1 issues and meet production performance constraints.

What is the safest way to add a NOT NULL column to a database schema?

Executing a multi-step migration plan with a rollback strategy is the safest way to add a NOT NULL column. This schema review approach applies non-blocking index creation techniques to prevent production outages and maintain data integrity.

Does database schema review work for NoSQL systems like MongoDB and DynamoDB?

Database schema review works for NoSQL systems including MongoDB, DynamoDB, and Redis. The analysis provides data modeling recommendations for primary keys, normalization, and safe denormalization tailored to both relational and NoSQL environments.

How do I fix N+1 query issues and design effective database indexes?

Fixing N+1 query issues involves analyzing application query patterns to design effective database indexes like GIN or BRIN. This query optimization process detects repetitive data fetching and recommends index structures that improve page load times.

What are the best practices for connection pool sizing and database maintenance?

Best practices for connection pool sizing and database maintenance include configuring pool limits and running vacuum checks. This operational guidance utilizes production monitoring queries like pg_stat_statements to ensure stable database performance.