database-indexing

Identify slow queries and optimize database performance with indexing strategies for PostgreSQL and MySQL.

3|Updated Feb 6, 2026
One-click install
npx skills add https://github.com/1Mangesh1/dev-skills-collection --skill database-indexing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-indexing
Source: https://github.com/1Mangesh1/dev-skills-collection/tree/main/skills/database-indexing
Command: npx skills add https://github.com/1Mangesh1/dev-skills-collection --skill database-indexing

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Slow database queries and unoptimized access patterns waste time and resources; this Skill provides indexing strategies and guidance to speed up data retrieval.

Core Features & Use Cases

  • Understand index types (B-tree, hash, full-text) and when to use them.
  • Design composite and covering indexes for common query patterns.
  • Analyze EXPLAIN plans and implement performance-tuning patterns for real-world workloads.
  • Real-world scenarios include filtering, joining, and sorting large tables to reduce latency.

Quick Start

Apply the recommended index strategy to a slow query to speed up its execution.

Frequently Asked Questions about database-indexing

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

FAQPage Schema
How do I optimize slow database queries using indexing in PostgreSQL and MySQL?

Optimize slow database queries by analyzing EXPLAIN plans to identify bottlenecks, then applying B-tree, hash, or full-text indexing strategies to improve data retrieval performance for common workloads.

What is the best way to design composite and covering indexes for large tables?

Design composite and covering indexes for large tables by aligning index structures with your specific query patterns, effectively optimizing operations that involve filtering, joining, and sorting large datasets.

When do I need full-text indexing versus a standard B-tree index?

You need full-text indexing when searching complex text patterns within string columns, whereas a standard B-tree index is better suited for exact matches, range queries, and sorting operations on large tables.

How does analyzing EXPLAIN plans improve query optimization?

Analyzing EXPLAIN plans improves query optimization by revealing the database execution path, allowing you to identify unoptimized access patterns and implement targeted indexing strategies to reduce latency.

Can I apply schema recommendations and index design to my existing database workloads?

You can apply schema recommendations and index design to existing database workloads, utilizing provided script-based tooling and references to implement performance-tuning patterns for real-world filtering and joining scenarios.

Why does adding indexes to a database schema not always speed up query performance?

Adding indexes does not always speed up query performance because poorly designed indexes can fail to match query patterns or cause overhead, making EXPLAIN plan analysis essential to ensure effective optimization.