The significant difference of these 2 plans is IndexHashJoin vs IndexJoin. The root cause should be the row count estimation error of the IndexJoin / IndexHashJoin and their child HashJoin, specifically, NDV for one of the join children nodes is not fully contained by the other one.
Development Task
For TPC-H Q3 with
sf=10
, the chosen plan and its execution statistics are:with
nth_plan(6)
hint, the plan and execution statistics are:The significant difference of these 2 plans is
IndexHashJoin
vsIndexJoin
. The root cause should be the row count estimation error of theIndexJoin
/IndexHashJoin
and their childHashJoin
, specifically, NDV for one of the join children nodes is not fully contained by the other one.The stats of the tables are stats.zip