Indexing Anti-Patterns and Maintenance/Be careful with low-cardinality flags

A boolean by itself is often weak unless paired with something else or made partial.

Section: Anti-patterns

Be careful with low-cardinality flags

sql
sql
-- Often weak by itself
INDEX (is_deleted)

-- Often better
INDEX (is_deleted, created_at)
-- or a partial index where supported
Explanation

A low-cardinality flag alone may still leave too much work for the engine.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Anti-patterns
Avoid duplicate or overlapping indexes
Do not keep several indexes that serve the same leading prefix needlessly.
OpenIn sheetsqlsame section
Remember unused index cost
Unused indexes still hurt writes and consume disk.
OpenIn sheettextsame section
PostgreSQL REINDEX
Rebuild a problematic or bloated index.
MySQL ANALYZE TABLE
Refresh optimizer statistics after big data shifts.
SQLite VACUUM after major churn
Compact the file after heavy changes when appropriate.