Change Null-safe equal operator from cross join to hash join (#2156)
* Change Null-safe equal operator from cross join to hash join ISSUE-2136 This commit change the join method from cross join to hash join when the equal operator is Null-safe '<=>'. It will improve the speed of query which has the Null-safe equal operator. The finds_nulls field is used to save if there is Null-safe operator. The finds_nulls[i] is true means that the i-th equal operator is Null-safe. The equal function in hash table will return true, if both val and loc are NULL when finds_nulls[i] is true.
This commit is contained in:
@ -148,7 +148,8 @@ Status AggregationNode::prepare(RuntimeState* state) {
|
||||
|
||||
// TODO: how many buckets?
|
||||
_hash_tbl.reset(new HashTable(
|
||||
_build_expr_ctxs, _probe_expr_ctxs, 1, true, id(), mem_tracker(), 1024));
|
||||
_build_expr_ctxs, _probe_expr_ctxs, 1, true,
|
||||
vector<bool>(_build_expr_ctxs.size(), false), id(), mem_tracker(), 1024));
|
||||
|
||||
if (_probe_expr_ctxs.empty()) {
|
||||
// create single output tuple now; we need to output something
|
||||
|
||||
Reference in New Issue
Block a user