Fixing PostgreSQL Partial Index Ignored When WHERE Clause Uses a Cast
Your partial index exists, VACUUM has run, and EXPLAIN still shows a sequential scan. The culprit is almost always a type mismatch between your query's WHERE clause and the index predicate. Here's how to diagnose and fix it fast.