EXPLAIN, ANALYZE, and Verify Index Usage

Use EXPLAIN tools across PostgreSQL, MySQL, SQLite, and MongoDB to prove whether an index actually helps.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Cross-database tools
PostgreSQL EXPLAIN ANALYZE
EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM users WHERE email = 'a@example.com';

# See actual runtime, loops, and buffer reads.

MySQL EXPLAIN
EXPLAIN SELECT * FROM users WHERE email = 'a@example.com';

# Inspect access path and chosen key.

SQLite EXPLAIN QUERY PLAN
EXPLAIN QUERY PLAN SELECT * FROM users WHERE email = 'a@example.com';

# Inspect scans versus indexed searches.

MongoDB executionStats
db.users.find({ email: 'a@example.com' }).explain('executionStats')

# Check keys examined and docs examined.

## What good looks like
Healthy plan signals
Look for:
- indexed search instead of full scan
- fewer rows/docs examined
- fewer extra sorts
- lower latency under realistic load
- acceptable write overhead

# A quick review checklist after creating an index.

Recommended next

No recommendations yet.