database-review

Reviews database code for N+1 queries, missing indexes, and transaction handling.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/petrogurcak/skills --skill database-review-petrogurcak
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-review
Source: https://github.com/petrogurcak/skills/tree/main/plugins/review/skills/database-review
Command: npx skills add https://github.com/petrogurcak/skills --skill database-review-petrogurcak

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill identifies and helps resolve common database performance bottlenecks in code, such as N+1 queries, missing indexes, and inefficient transaction handling.

Core Features & Use Cases

  • N+1 Query Detection: Identifies and suggests fixes for inefficient loops that trigger multiple database queries.
  • Index Optimization: Checks for missing or suboptimal indexes on columns used in WHERE, JOIN, and ORDER BY clauses.
  • Transaction Management: Reviews for proper use of transactions to ensure data integrity and prevent deadlocks.
  • Connection Pooling: Verifies that connection pooling is configured correctly to handle load efficiently.
  • Query Pattern Analysis: Assesses queries for issues like SELECT * or lack of LIMIT clauses.
  • Use Case: When experiencing slow API response times related to database operations, use this skill to pinpoint and fix the underlying query inefficiencies.

Quick Start

Review the database code in the provided file for performance issues and potential optimizations.

Frequently Asked Questions about database-review

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

FAQPage Schema
How do I fix N+1 queries and database performance issues in my code?

To fix N+1 queries and database performance issues, review your code for inefficient loops triggering multiple queries, missing indexes on WHERE and JOIN columns, and poor transaction handling to pinpoint slow API response times.

What are common database query patterns that cause slow API response times?

Common query patterns causing slow API responses include N+1 queries in loops, missing indexes on filtered columns, unoptimized transaction handling, improper connection pooling, and inefficient practices like SELECT * or missing LIMIT clauses.

Can I review both SQL and ORM layers for database optimization?

Yes, you can review both SQL and ORM layers for database optimization. The analysis assesses code-level query patterns across both layers to identify missing indexes, poor transaction management, and inefficient connection pooling configurations.

Does this database code review check for missing indexes and connection pooling?

Yes, this database code review checks for missing indexes on WHERE, JOIN, and ORDER BY columns, and verifies that connection pooling is configured correctly to handle database load efficiently without deadlocks.

When should I review transaction handling in my database code?

You should review transaction handling in your database code when preparing for scaling, debugging performance issues, or ensuring data integrity. Proper transaction management prevents deadlocks and optimizes slow database operations.