Database Indexing Basics and Access Patterns
Core indexing concepts, selectivity, left-prefix behavior, and practical heuristics for when to add an index.
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Core concepts
## Quick checklist
1. Is the query slow enough to matter? 2. Is the pattern common in production? 3. Is the filter selective? 4. Can one composite index cover multiple common queries? 5. Does EXPLAIN show scans or expensive sorts? 6. What write and storage cost will this add?
# Use this checklist before creating a new index.
More in Database Indexing
Indexing Anti-Patterns and Maintenance
Avoid over-indexing, duplicate indexes, low-value indexes, stale statistics, and maintenance mistakes.
EXPLAIN, ANALYZE, and Verify Index Usage
Use EXPLAIN tools across PostgreSQL, MySQL, SQLite, and MongoDB to prove whether an index actually helps.
Partial, Expression, and Functional Indexes
High-leverage index patterns for subsets of data and computed predicates across PostgreSQL, MySQL, and SQLite.
MongoDB Index Types and Query Patterns
Single-field, compound, multikey, text, wildcard, partial, TTL, and unique index patterns for MongoDB.
SQLite Indexes and Query Planner
SQLite CREATE INDEX patterns, expression and partial indexes, EXPLAIN QUERY PLAN, and lightweight performance tuning.
MySQL Index Strategies and Verification
Composite indexes, invisible indexes, descending indexes, generated-column indexing, and EXPLAIN workflows in MySQL.