diff --git a/src/include/duckdb/storage/compression/dictionary/compression.hpp b/src/include/duckdb/storage/compression/dictionary/compression.hpp index b0f29dc5901f..09f1f44bdce2 100644 --- a/src/include/duckdb/storage/compression/dictionary/compression.hpp +++ b/src/include/duckdb/storage/compression/dictionary/compression.hpp @@ -47,7 +47,6 @@ struct DictionaryCompressionCompressState : public DictionaryCompressionState { data_ptr_t current_end_ptr; // Buffers and map for current segment - StringHeap heap; string_map_t current_string_map; vector index_buffer; vector selection_buffer; diff --git a/src/storage/compression/dictionary/compression.cpp b/src/storage/compression/dictionary/compression.cpp index 064697fc7c54..64a3db4028e0 100644 --- a/src/storage/compression/dictionary/compression.cpp +++ b/src/storage/compression/dictionary/compression.cpp @@ -6,8 +6,7 @@ namespace duckdb { DictionaryCompressionCompressState::DictionaryCompressionCompressState(ColumnDataCheckpointData &checkpoint_data_p, const CompressionInfo &info) : DictionaryCompressionState(info), checkpoint_data(checkpoint_data_p), - function(checkpoint_data.GetCompressionFunction(CompressionType::COMPRESSION_DICTIONARY)), - heap(BufferAllocator::Get(checkpoint_data.GetDatabase())) { + function(checkpoint_data.GetCompressionFunction(CompressionType::COMPRESSION_DICTIONARY)) { CreateEmptySegment(checkpoint_data.GetRowGroup().start); } @@ -72,7 +71,9 @@ void DictionaryCompressionCompressState::AddNewString(string_t str) { if (str.IsInlined()) { current_string_map.insert({str, index_buffer.size() - 1}); } else { - current_string_map.insert({heap.AddBlob(str), index_buffer.size() - 1}); + string_t dictionary_string((const char *)dict_pos, UnsafeNumericCast(str.GetSize())); // NOLINT + D_ASSERT(!dictionary_string.IsInlined()); + current_string_map.insert({dictionary_string, index_buffer.size() - 1}); } DictionaryCompression::SetDictionary(*current_segment, current_handle, current_dictionary);