The Best (Query) Plans of Mice and Men
Summary
This article analyzes how PostgreSQL caches and reuses query plans, and how that behavior interacts with partial indexes and prepared statements. It provides practical guidance and code examples for forcing custom plans or inlining parameters to ensure fast query performance in realistic workloads.