Merge pull request #57787 from kitaisreal/serialization-string-reduce-memory-usage

SerializationString reduce memory usage
This commit is contained in:
Alexey Milovidov 2023-12-13 19:56:56 +01:00 committed by GitHub
commit e989eb7bd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -175,7 +175,7 @@ static NO_INLINE void deserializeBinarySSE2(ColumnString::Chars & data, ColumnSt
offsets.push_back(offset);
if (unlikely(offset > data.size()))
data.resize(roundUpToPowerOfTwoOrZero(std::max(offset, data.size() * 2)));
data.resize_exact(roundUpToPowerOfTwoOrZero(std::max(offset, data.size() * 2)));
if (size)
{

View File

@ -11,9 +11,11 @@ SETTINGS index_granularity = 1024, index_granularity_bytes = '10Mi';
INSERT INTO order_by_desc SELECT number, repeat('a', 1024) FROM numbers(1024 * 300);
OPTIMIZE TABLE order_by_desc FINAL;
SELECT s FROM order_by_desc ORDER BY u DESC LIMIT 10 FORMAT Null;
SELECT s FROM order_by_desc ORDER BY u DESC LIMIT 10 FORMAT Null
SETTINGS max_memory_usage = '400M';
SELECT s FROM order_by_desc ORDER BY u LIMIT 10 FORMAT Null;
SELECT s FROM order_by_desc ORDER BY u LIMIT 10 FORMAT Null
SETTINGS max_memory_usage = '400M';
SYSTEM FLUSH LOGS;