1.4.9 Planner Preprocessing: Subquery Pull-up, Predicate Pushdown, Equivalence Classes (opens in new tab)
So far we have seen the planner build candidate paths and rank them by cost, choose join methods and join orders, and estimate those costs from statistics. But before any of that cost comparison begins, the planner does something else first. It takes the incoming Query tree and rewrites it once into a shape that is easier to optimize. That rewriting is preprocessing. In processing order, preprocessing is the planner's very first step. Yet why it pays off only becomes clear once you understand...
Read the original article