Skip to content
aj-geddes avatar

Database Indexing Strategy

Practical guide to PostgreSQL and MySQL indexing covering index type choice, composite and partial design, and maintenance.

CCM score
37 of 100
skills.sh installs
493
GitHub stars
396
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers index creation planning, B-tree, Hash, GiST, and BRIN type selection, and full-text search index design
  • Includes reference guides for PostgreSQL index types, MySQL index types, and single-column, composite, partial, and expression indexes
  • Shows B-tree examples for equality and range queries, composite indexes, and partial indexes filtered on cancelled_at IS NULL
  • Designed for developers optimizing query performance and storage in PostgreSQL or MySQL databases

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill database-indexing-strategy -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Database Indexing Strategy

Table of Contents

Overview

Design comprehensive indexing strategies to improve query performance, reduce lock contention, and maintain data integrity. Covers index types, design patterns, and maintenance procedures.

When to Use

  • Index creation and planning
  • Query performance optimization through indexing
  • Index type selection (B-tree, Hash, GiST, BRIN)
  • Composite and partial index design
  • Index maintenance and monitoring
  • Storage optimization with indexes
  • Full-text search index design

Quick Start

B-tree Indexes (Default):

-- Standard equality and range queries
CREATE INDEX idx_users_email ON users(email);
CREATE INDEX idx_orders_created_at ON orders(created_at DESC);

-- Composite indexes for multi-column queries
CREATE INDEX idx_orders_user_status
ON orders(user_id, status)
WHERE cancelled_at IS NULL;

Reference Guides

Detailed implementations in the references/ directory:

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Category
Databases
First seen
Jun 3, 2026

Questions

What does the database-indexing-strategy skill do?

The database-indexing-strategy skill designs and implements database indexing strategies for PostgreSQL and MySQL. It covers index types such as B-tree, Hash, GiST and BRIN, composite and partial indexes, and index maintenance and monitoring.

How do I install the database-indexing-strategy skill?

Run npx -y skills add aj-geddes/useful-ai-prompts --skill database-indexing-strategy -y in your project. After that, database-indexing-strategy lets the agent create indexes, choose index types and tune index performance.

Which databases does the database-indexing-strategy skill support?

The database-indexing-strategy skill targets PostgreSQL and MySQL, with separate reference guides for the index types of each database. It also covers full-text search index design.

Where does the database-indexing-strategy skill stand in the Databases category?

The database-indexing-strategy skill is listed in the Databases category on Claude Marketplaces, alongside supabase-postgres-best-practices and several Prisma skills. Unlike those, it focuses on indexing design and index type selection rather than client APIs or database setup.

More from aj-geddes/useful-ai-prompts

All 258

Similar to Database Indexing Strategy

More Databases