On Wed, Sep 11, 2019 at 4:48 AM Alvaro Herrera from 2ndQuadrant <alvherre@alvh.no-ip.org> wrote:
So in this patch, the input restrictlist is modified to include the clauses generated by generate_join_implied_equalities_for_all. That doesn't seem okay -- doesn't it affect downstream usage of the restrictlist in the caller of set_joinrel_size_estimates?
Actually the joinclauses generated by generate_join_implied_equalities_for_all only affects the restrictlist used in have_partkey_equi_join to check equi-join conditions for partition keys. The input restrictlist would not be altered.
I wonder if it's possible to do this by using the ECs directly in have_partkey_equi_join instead of using them to create fake join clauses.
Hmm.. I thought about this option and at last figured that what we need to do in have_partkey_equi_join with the ECs is actually the same as in generate_join_implied_equalities_for_all. Maybe I didn't think it correctly.