Learn VisualLearn DB

Account for Reads and Writes

Indexes are valuable when they reduce enough read work to repay traversal and heap access. For example, a status = 'active' filter matching 90% of rows has low selectivity, so an index still touches nearly every page. An index on name also cannot serve WHERE lower(name) = … — that needs an expression index. Every index also consumes storage and adds maintenance to INSERT, UPDATE, and DELETE.

GOAL

Recognize when an index is mismatched or more expensive.

Why avoid unused indexes?