dbms: do not allocate memory for default strings in cache dictionaries [#METR-17328]

This commit is contained in:
Andrey Mironov 2015-11-25 17:22:14 +03:00
parent 83cf1f81ec
commit 1ca3d930da
2 changed files with 8 additions and 4 deletions

View File

@ -522,7 +522,10 @@ private:
else
{
const auto string_ref = cell.isDefault() ? get_default(row) : attribute_array[cell_idx];
map[id] = String{string_ref};
if (!cell.isDefault())
map[id] = String{string_ref};
total_length += string_ref.size + 1;
}
}
@ -551,8 +554,6 @@ private:
out->getChars().reserve(total_length);
// const auto & null_value = std::get<String>(attribute.null_values);
for (const auto row : ext::range(0, ext::size(ids)))
{
const auto id = ids[row];

View File

@ -557,7 +557,10 @@ private:
else
{
const auto string_ref = cell.isDefault() ? get_default(row) : attribute_array[cell_idx];
map[key] = String{string_ref};
if (!cell.isDefault())
map[key] = String{string_ref};
total_length += string_ref.size + 1;
}
}