ClickHouse / ClickHouse/ClickHouse

SelectedRows and SelectedBytes metrics count INSERTed bytes too

Open
#61,907 0 comments 1 reaction 0 assignees View on GitHub
comp-logging unexpected behaviour
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.