@@ -67,9 +67,9 @@ void PartitionedTupleData::AppendUnified(PartitionedTupleDataAppendState &state,
6767 auto &partition = *partitions[partition_index.GetIndex ()];
6868 auto &partition_pin_state = state.partition_pin_states [partition_index.GetIndex ()];
6969
70- const auto size_before = partition.SizeInBytes () ;
70+ const auto size_before = partition.data_size ;
7171 partition.AppendUnified (partition_pin_state, state.chunk_state , input, append_sel, actual_append_count);
72- data_size += partition.SizeInBytes () - size_before;
72+ data_size += partition.data_size - size_before;
7373 } else {
7474 // Compute the heap sizes for the whole chunk
7575 if (!layout.AllConstant ()) {
@@ -103,9 +103,9 @@ void PartitionedTupleData::Append(PartitionedTupleDataAppendState &state, TupleD
103103
104104 state.chunk_state .heap_sizes .Reference (input.heap_sizes );
105105
106- const auto size_before = partition.SizeInBytes () ;
106+ const auto size_before = partition.data_size ;
107107 partition.Build (partition_pin_state, state.chunk_state , 0 , append_count);
108- data_size += partition.SizeInBytes () - size_before;
108+ data_size += partition.data_size - size_before;
109109
110110 partition.CopyRows (state.chunk_state , input, *FlatVector::IncrementalSelectionVector (), append_count);
111111 } else {
@@ -224,9 +224,9 @@ void PartitionedTupleData::BuildBufferSpace(PartitionedTupleDataAppendState &sta
224224 const auto partition_offset = partition_entry.offset - partition_length;
225225
226226 // Build out the buffer space for this partition
227- const auto size_before = partition.SizeInBytes () ;
227+ const auto size_before = partition.data_size ;
228228 partition.Build (partition_pin_state, state.chunk_state , partition_offset, partition_length);
229- data_size += partition.SizeInBytes () - size_before;
229+ data_size += partition.data_size - size_before;
230230 }
231231}
232232
@@ -337,7 +337,7 @@ idx_t PartitionedTupleData::Count() const {
337337}
338338
339339idx_t PartitionedTupleData::SizeInBytes () const {
340- return data_size;
340+ return data_size + stl_allocator-> AllocationSize () ;
341341}
342342
343343idx_t PartitionedTupleData::PartitionCount () const {
@@ -361,7 +361,7 @@ void PartitionedTupleData::Verify() const {
361361 for (auto &partition : partitions) {
362362 partition->Verify ();
363363 total_count += partition->Count ();
364- total_size += partition->SizeInBytes () ;
364+ total_size += partition->data_size ;
365365 }
366366 D_ASSERT (total_count == this ->count );
367367 D_ASSERT (total_size == this ->data_size );
0 commit comments