Database Anti-Patterns

Detect database performance anti-patterns in TypeScript and SQL code.

1|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/JaveedIshaq/ai-workflow-orchestrator --skill database-anti-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Database Anti-Patterns
Source: https://github.com/JaveedIshaq/ai-workflow-orchestrator/tree/main/templates/skills/db-anti-patterns
Command: npx skills add https://github.com/JaveedIshaq/ai-workflow-orchestrator --skill database-anti-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps developers identify and fix common database performance anti-patterns, ensuring efficient and scalable data operations.

Core Features & Use Cases

  • N+1 Query Detection: Identifies inefficient loops that cause excessive database calls.
  • Sequential Query Optimization: Detects queries that could be run in parallel using Promise.all.
  • Unbounded Fetch Prevention: Enforces limits on data retrieval to prevent overwhelming the database.
  • Index Missing Detection: Highlights queries on non-indexed columns and suggests index creation.
  • Connection Pool Management: Guides against creating new connections per request and advises on keeping transactions short.
  • Use Case: A developer can use this skill to scan their codebase and receive actionable advice on how to refactor slow database queries, leading to a faster and more responsive application.

Quick Start

Scan the current project's source code for database anti-patterns using the provided bash script.

Frequently Asked Questions about Database Anti-Patterns

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

FAQPage Schema
How do I detect N+1 queries and sequential query performance issues in my codebase?

You can detect N+1 queries and sequential query issues using provided grep and SQL scripts to identify inefficient loops, enabling refactoring with Promise.all for parallel database execution.

What is an unbounded fetch and how do I prevent it in SQL queries?

An unbounded fetch retrieves unlimited rows that can overwhelm a database. You prevent it by enforcing strict limits on data retrieval in SQL queries to cap the returned result set.

How do I find missing indexes on database columns causing slow queries?

You find missing indexes by analyzing SQL queries that operate on non-indexed columns, which suggests targeted index creation to accelerate slow database query performance.

How do I fix connection pool exhaustion in backend applications?

You fix connection pool exhaustion by avoiding new database connections per request and keeping transactions short, which stabilizes backend applications and prevents pool depletion.

Can I scan for SQL anti-patterns and get TypeScript code examples for fixes?

Yes, you can scan for SQL anti-patterns using bash scripts and receive actionable TypeScript and SQL code examples to refactor slow database queries into optimized operations.