mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Merge pull request #49323 from ClickHouse/low-cardinality-fix-progress
Fix progress bar for LowCardinality fields with shared dictionaries
This commit is contained in:
commit
79ad150454
@ -160,7 +160,9 @@ public:
|
||||
|
||||
void reserve(size_t n) override { idx.reserve(n); }
|
||||
|
||||
size_t byteSize() const override { return idx.getPositions()->byteSize() + getDictionary().byteSize(); }
|
||||
/// Don't count the dictionary size as it can be shared between different blocks.
|
||||
size_t byteSize() const override { return idx.getPositions()->byteSize(); }
|
||||
|
||||
size_t byteSizeAt(size_t n) const override { return getDictionary().byteSizeAt(getIndexes().getUInt(n)); }
|
||||
size_t allocatedBytes() const override { return idx.getPositions()->allocatedBytes() + getDictionary().allocatedBytes(); }
|
||||
|
||||
|
@ -122,11 +122,12 @@ def test_metrics_storage_buffer_size(start_cluster):
|
||||
)
|
||||
== "1\n"
|
||||
)
|
||||
# By the way, this metric does not count the LowCardinality's dictionary size.
|
||||
assert (
|
||||
node1.query(
|
||||
"SELECT value FROM system.metrics WHERE metric = 'StorageBufferBytes'"
|
||||
)
|
||||
== "24\n"
|
||||
== "1\n"
|
||||
)
|
||||
|
||||
node1.query("INSERT INTO test.buffer_table VALUES('hello');")
|
||||
@ -140,7 +141,7 @@ def test_metrics_storage_buffer_size(start_cluster):
|
||||
node1.query(
|
||||
"SELECT value FROM system.metrics WHERE metric = 'StorageBufferBytes'"
|
||||
)
|
||||
== "25\n"
|
||||
== "2\n"
|
||||
)
|
||||
|
||||
# flush
|
||||
|
Loading…
Reference in New Issue
Block a user