ClickHouse / ClickHouse/ClickHouse
SelectedRows and SelectedBytes metrics count INSERTed bytes too
- Dominant language
- C++
- Stars
- 49.9k
- Forks
- 9k
- Avg merge
- 21h 32m
- Merged PRs (30d)
- 515
Description
INSERT into a table from file (not INSERT SELECT) and check SelectedBytes before and after:
```
:) create table a (x Int64) engine MergeTree order by x
:) select formatReadableSize(value) from system.events where name = 'SelectedBytes'
┌─formatReadableSize(value)─┐
│ 1.60 GiB │
└───────────────────────────┘
```
```
% seq 100000000 | build/programs/clickhouse client -nq "insert into a format CSV"
```
```
:) select formatReadableSize(value) from system.events where name = 'SelectedBytes'
┌─formatReadableSize(value)─┐
│ 2.34 GiB │
└───────────────────────────┘
```
All the inserted bytes counted towards SelectedBytes. This seems wrong and seems to contradict the documentation for SelectedBytes: "Number of bytes (uncompressed; for columns as they stored in memory) SELECTed from all tables."
Contributor guide
Assessment
This issue has not been assessed yet.