Improve run-time partition pruning to handle any stable expression.
Tom Lane <tgl@sss.pgh.pa.us>
Improve run-time partition pruning to handle any stable expression. The initial coding of the run-time-pruning feature only coped with cases where the partition key(s) are compared to Params. That is a bit silly; we can allow it to work with any non-Var-containing stable expression, as long as we take special care with expressions containing PARAM_EXEC Params. The code is hardly any longer this way, and it's considerably clearer (IMO at least). Per gripe from Pavel Stehule. David Rowley, whacked around a bit by me Discussion: https://postgr.es/m/CAFj8pRBjrufA3ocDm8o4LPGNye9Y+pm1b9kCwode4X04CULG3g@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/executor/execPartition.c | modified | +130 −118 |
| src/backend/executor/nodeAppend.c | modified | +25 −28 |
| src/backend/nodes/copyfuncs.c | modified | +5 −2 |
| src/backend/nodes/outfuncs.c | modified | +8 −2 |
| src/backend/nodes/readfuncs.c | modified | +5 −2 |
| src/backend/partitioning/partprune.c | modified | +138 −81 |
| src/include/executor/execPartition.h | modified | +19 −19 |
| src/include/nodes/primnodes.h | modified | +9 −3 |
| src/include/partitioning/partprune.h | modified | +12 −8 |
| src/test/regress/expected/partition_prune.out | modified | +86 −4 |
| src/test/regress/sql/partition_prune.sql | modified | +24 −4 |
Discussion
- why partition pruning doesn't work? 72 messages · 2018-06-01 → 2018-07-18