in hash join condition, some equals are trustable, some are not. an equal is trustable if one side is almost unique, like primary key. for such equal condition we could estimate more accurate. the problem is in rewriten q20, the are 2 equal condition, one is trustable, another is not. But we treat both of them as trustable. Test result: on tpch100, from 2.2 sec to 0.44 sec no impact on tpch other queries no performance impact on tpcds queries