Database Index and Query Path Checklist
Indexes help databases find rows without scanning everything. A slow query often means the database is reading too much data, using the wrong index or doing work that should be simplified.
Core principle
A query is a path through data. Indexes are shortcuts. Before adding indexes, understand what the query asks for, which columns filter data and whether the database already has a useful path.
Checklist
- Identify the slow query or slow page.
- Find which table is involved.
- Check table size.
- Check existing indexes.
- Use EXPLAIN to inspect query plan.
- Look for full table scans on large tables.
- Check WHERE, JOIN and ORDER BY columns.
- Add indexes only when justified.
- Test query performance after change.
- Document why the index exists.
Reusable lesson
Index thinking applies to WordPress meta queries, ecommerce filters, analytics tables, logs, search features, dashboards and reporting systems.
When to Use This Checklist
Use this checklist when a database-backed page, dashboard, report or WordPress admin screen is slow because of query behavior.
Required Tools
Database access, slow query, table name, MySQL CLI, backup, staging environment if possible
Before You Start
Do not add indexes randomly. Every index speeds some reads but can add storage and write overhead.
Structured Checklist Steps
- Identify slow query.
- Identify table.
- Check table size.
- Show indexes.
- Run EXPLAIN.
- Check full scans.
- Review filter columns.
- Add justified index.
- Test performance.
- Document index reason.
Verification Steps
- Slow query is identified.
- Query plan is understood.
- Index change is justified.
- Performance is measured after change.
- Rollback plan exists.
Rollback Plan
If a new index causes unexpected write slowdown or maintenance issues, drop the index in a controlled window after confirming it is not required.
Common Mistakes
- Adding indexes blindly.
- Ignoring query plan.
- Indexing tiny tables unnecessarily.
- Not testing after change.
- Forgetting write overhead.
Related Commands
SHOW INDEX FROM table_name;
EXPLAIN SELECT * FROM table_name WHERE column_name='value';
SELECT COUNT(*) FROM table_name;
ALTER TABLE table_name ADD INDEX idx_column_name (column_name);
ALTER TABLE table_name DROP INDEX idx_column_name;