• H
    Use PartitionSelectors for partition elimination, even without ORCA. · e378d84b
    Heikki Linnakangas 提交于
    The old mechanism was to scan the complete plan, searching for a pattern
    with a Join, where the outer side included an Append node. The inner
    side was duplicated into an InitPlan, with the pg_partition_oid aggregate
    to collect the Oids of all the partitions that can match. That was
    inefficient and broken: if the duplicated plan was volatile, you might
    choose wrong partitions. And scanning the inner side twice can obviously
    be slow, if there are a lot of tuples.
    
    Rewrite the way such plans are generated. Instead of using an InitPlan,
    inject a PartitionSelector node into the inner side of the join.
    
    Fixes github issues #2100 and #2116.
    e378d84b
dpe_optimizer.out 113.2 KB