Yes, in old planner only hashjoin is enabled by default, mergejoin and nestloop are both disabled. However hashjoin can't handle all the case, such as "select * from a,b where p>q" where column p and column q comes from table a and table b respectively. So in the first path no plan is generated. And then root->config->mpp_trying_fallback_plan is set to true, which enables all join method and try them all. You can check the function add_paths_to_joinrel which is called for join path generation.
2016-12-21 16:47 GMT+08:00 Paul Guo <[email protected]>: > { > {"enable_nestloop", PGC_USERSET, QUERY_TUNING_METHOD, > gettext_noop("Enables the planner's use of nested-loop join > plans."), > NULL > }, > &enable_nestloop, > false, NULL, NULL > }, > { > {"enable_mergejoin", PGC_USERSET, QUERY_TUNING_METHOD, > gettext_noop("Enables the planner's use of merge join plans."), > NULL > }, > &enable_mergejoin, > false, NULL, NULL > }, > > I just checked greenplum/gpdb. The two guc are disabled by default also. > Anyone know the reason or history? thanks. >
