Skip to content

Make read buffer size lower, while reading from compact parts#12492

Merged
CurtizJ merged 5 commits intoClickHouse:masterfrom
CurtizJ:polymorphic-parts-4
Jul 27, 2020
Merged

Make read buffer size lower, while reading from compact parts#12492
CurtizJ merged 5 commits intoClickHouse:masterfrom
CurtizJ:polymorphic-parts-4

Conversation

@CurtizJ
Copy link
Copy Markdown
Member

@CurtizJ CurtizJ commented Jul 14, 2020

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Bug Fix

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fixed performance issue, while reading from compact parts.

@CurtizJ CurtizJ added pr-bugfix Pull request with bugfix, not backported by default pr-performance Pull request with some performance improvements labels Jul 14, 2020
@CurtizJ CurtizJ force-pushed the polymorphic-parts-4 branch from 13de710 to 1a11bc7 Compare July 14, 2020 16:26
@CurtizJ CurtizJ force-pushed the polymorphic-parts-4 branch 2 times, most recently from c6423b2 to 6963288 Compare July 19, 2020 12:37
@CurtizJ CurtizJ marked this pull request as ready for review July 22, 2020 15:35
@KochetovNicolai KochetovNicolai self-assigned this Jul 22, 2020
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I've got the idea: we need for find the largest granule and limit buffer size if possible.
Still, comment will be helpful: what this function does and what why do we care calculating this stuff instead of using max_read_buffer_size.

Also, it is not clear what would we use inside function. Like we need column_positions filled, data_part, marks_loader (is it all?). This function may be made static with implicit arguments to avoid possible usage of uninitialized members.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be really nice to implement iterator here. Cause this lambda captures all variables, and some of them changed later in unpredictable way. Readability of it is pretty low.

Copy link
Copy Markdown
Member

@KochetovNicolai KochetovNicolai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to make a perftest which shows that something has improved.

@CurtizJ CurtizJ force-pushed the polymorphic-parts-4 branch from 6963288 to 61018c2 Compare July 23, 2020 15:38
@CurtizJ
Copy link
Copy Markdown
Member Author

CurtizJ commented Jul 23, 2020

I also added one change from #12183 to this PR. Now compressed block is written for every part of column in granule. It should significanty increase performance of reading, but maybe writing will slow down. Let's look to perf tests.

@alexey-milovidov
Copy link
Copy Markdown
Member

but maybe writing will slow down. Let's look to perf tests.

And if it's Ok let's apply this change unconditionally (without a setting).

Copy link
Copy Markdown
Member

@KochetovNicolai KochetovNicolai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CurtizJ
Copy link
Copy Markdown
Member Author

CurtizJ commented Jul 24, 2020

Perf tests look ok.

Insert:
image

Select:
image

CurtizJ added a commit that referenced this pull request Jul 27, 2020
Backport #12492 to 20.6: Make read buffer size lower, while reading from compact parts
robot-clickhouse pushed a commit that referenced this pull request Jul 28, 2020
robot-clickhouse pushed a commit that referenced this pull request Jul 28, 2020
robot-clickhouse pushed a commit that referenced this pull request Jul 28, 2020
CurtizJ added a commit that referenced this pull request Jul 28, 2020
Backport #12492 to 20.4: Make read buffer size lower, while reading from compact parts
CurtizJ added a commit that referenced this pull request Jul 28, 2020
Backport #12492 to 20.5: Make read buffer size lower, while reading from compact parts
CurtizJ added a commit that referenced this pull request Jul 28, 2020
Backport #12492 to 20.3: Make read buffer size lower, while reading from compact parts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default pr-performance Pull request with some performance improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants