Quick hack to allow the outer query's tuple_fraction to be passed down
Tom Lane <tgl@sss.pgh.pa.us>
Quick hack to allow the outer query's tuple_fraction to be passed down to a subquery if the outer query is simple enough that the LIMIT can be reflected directly to the subquery. This didn't use to be very interesting, because a subquery that couldn't have been flattened into the upper query was usually not going to be very responsive to tuple_fraction anyway. But with new code that allows UNION ALL subqueries to pay attention to tuple_fraction, this is useful to do. In particular this lets the optimization occur when the UNION ALL is directly inside a view.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/path/allpaths.c | modified | +42 −2 |
| src/backend/optimizer/plan/planmain.c | modified | +4 −1 |
| src/include/nodes/relation.h | modified | +3 −1 |