Skip to content

Commit

Permalink
added thread local state for reduced allocations
Browse files Browse the repository at this point in the history
  • Loading branch information
gropaul committed Feb 22, 2024
1 parent 4f643fb commit ff2f9d5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/execution/join_hashtable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ static void InsertHashesLoop(atomic<aggr_ht_entry_t> entries[], Vector row_locat

D_ASSERT(hashes_v.GetType().id() == LogicalType::HASH);


// we start out with all entries [0, 1, 2, ..., groups.size()]
const SelectionVector *sel_vector = FlatVector::IncrementalSelectionVector();

Expand Down Expand Up @@ -481,8 +480,8 @@ static void InsertHashesLoop(atomic<aggr_ht_entry_t> entries[], Vector row_locat
// sequentially
// We can't use the standard flat vector as this one has no internal selection vector and the Match
// Function Also marks the found rows in the selection vector, so we need to make sure there is one
data_collection->Gather(row_locations, entry_compare_sel_vector, need_compare_count,
state.lhs_data, entry_compare_sel_vector, state.chunk_state.cached_cast_vectors);
data_collection->Gather(row_locations, entry_compare_sel_vector, need_compare_count, state.lhs_data,
entry_compare_sel_vector, state.chunk_state.cached_cast_vectors);

TupleDataCollection::ToUnifiedFormat(state.chunk_state, state.lhs_data);

Expand Down

1 comment on commit ff2f9d5

@gropaul
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2nd Version: Memory allocated once per thread instead of for every vector

Please sign in to comment.