SQL Index Choices Cheat Sheet

B-tree, hash, composite, and partial indexes

Last Updated: November 21, 2025

Focus Areas

Focus
Match filters with columns in where clauses
Use partial indexes for sparse data sets

Commands & Queries

EXPLAIN ANALYZE SELECT ...
Check index usage
CREATE INDEX idx_name ON table(col1, col2)
Add a composite index
DROP INDEX idx_name
Remove unused index

Summary

Tune indexes to accelerate queries without bloating write costs.

💡 Pro Tip: Review execution plans before adding indexes and avoid over-indexing.
← Back to Databases & APIs | Browse all categories | View all cheat sheets