diff options
author | Arne Juul <arnej@verizonmedia.com> | 2020-10-20 12:05:11 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2020-10-20 12:15:47 +0000 |
commit | c2abdf9bb597e1dd2c49764f32e06af4d6940420 (patch) | |
tree | b267094b5a6d1612bd82230969b24c2a3d71d24a /eval | |
parent | 36f8d6761ef4bed884c884c7f673e6c7d847af7f (diff) |
better estimate no-overlap case
Diffstat (limited to 'eval')
-rw-r--r-- | eval/src/vespa/eval/instruction/generic_join.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/eval/src/vespa/eval/instruction/generic_join.cpp b/eval/src/vespa/eval/instruction/generic_join.cpp index c7bb17a808e..86720d6e539 100644 --- a/eval/src/vespa/eval/instruction/generic_join.cpp +++ b/eval/src/vespa/eval/instruction/generic_join.cpp @@ -37,7 +37,11 @@ generic_mixed_join(const Value &lhs, const Value &rhs, const JoinParam ¶m) auto lhs_cells = lhs.cells().typify<LCT>(); auto rhs_cells = rhs.cells().typify<RCT>(); SparseJoinState sparse(param.sparse_plan, lhs.index(), rhs.index()); - auto builder = param.factory.create_value_builder<OCT>(param.res_type, param.sparse_plan.sources.size(), param.dense_plan.out_size, sparse.first_index.size()); + size_t expected_subspaces = sparse.first_index.size(); + if (param.sparse_plan.lhs_overlap.empty() && param.sparse_plan.rhs_overlap.empty()) { + expected_subspaces = sparse.first_index.size() * sparse.second_index.size(); + } + auto builder = param.factory.create_value_builder<OCT>(param.res_type, param.sparse_plan.sources.size(), param.dense_plan.out_size, expected_subspaces); auto outer = sparse.first_index.create_view({}); auto inner = sparse.second_index.create_view(sparse.second_view_dims); outer->lookup({}); |