]> granicus.if.org Git - postgresql/commit
Improve run-time partition pruning to handle any stable expression.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 10 Jun 2018 19:22:25 +0000 (15:22 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 10 Jun 2018 19:22:32 +0000 (15:22 -0400)
commit73b7f48f78d27b1baf1a6541cbaae0fe6bd6186d
treec5e92bd3ae8eed8d8cf3519c10b12982d44bcfa8
parentc83e2029909c5411ca11fd841851016f1f9810e6
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
src/backend/executor/execPartition.c
src/backend/executor/nodeAppend.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/partitioning/partprune.c
src/include/executor/execPartition.h
src/include/nodes/primnodes.h
src/include/partitioning/partprune.h
src/test/regress/expected/partition_prune.out
src/test/regress/sql/partition_prune.sql