-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug](column) fix append_data_by_selector_impl reserve too mush useless memory #39581
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
be/src/vec/columns/column_impl.h
Outdated
|
||
res->reserve(num_rows); | ||
DCHECK_GE(end, begin); | ||
res->reserve(end - begin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add comment here to explain why need using this variable to reserve memory not using num rows
TPC-H: Total hot run time: 38420 ms
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
run buildall |
TPC-H: Total hot run time: 38573 ms
|
TPC-DS: Total hot run time: 190611 ms
|
ClickBench: Total hot run time: 31.25 s
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ss memory (apache#39581) ## Proposed changes ``` for (auto* place : local_state._value_places) { SCOPED_TIMER(local_state._selector_block_timer); RETURN_IF_ERROR(place->append_block_by_selector(input_block, eos)); } for (int i = 0; i < mutable_columns.size(); ++i) { columns[i]->append_data_by_selector(mutable_columns[i], _selector); } ``` the columns[I] size is 4096, and _selector size is 1; so the (4096 - 1) rows is useless; in a usercase, the block have 4096 rows and 34 columns. so need bytes is: 1 block * 4096 rows * 4096 reserve * 16 bytes * 34 column * 48 instance = 438086664192 bytes; it's will cause the query canceled as not have enough memory.
…ss memory (#39581) ## Proposed changes ``` for (auto* place : local_state._value_places) { SCOPED_TIMER(local_state._selector_block_timer); RETURN_IF_ERROR(place->append_block_by_selector(input_block, eos)); } for (int i = 0; i < mutable_columns.size(); ++i) { columns[i]->append_data_by_selector(mutable_columns[i], _selector); } ``` the columns[I] size is 4096, and _selector size is 1; so the (4096 - 1) rows is useless; in a usercase, the block have 4096 rows and 34 columns. so need bytes is: 1 block * 4096 rows * 4096 reserve * 16 bytes * 34 column * 48 instance = 438086664192 bytes; it's will cause the query canceled as not have enough memory.
Proposed changes
the columns[I] size is 4096, and _selector size is 1;
so the (4096 - 1) rows is useless;
in a usercase, the block have 4096 rows and 34 columns.
so need bytes is:
1 block * 4096 rows * 4096 reserve * 16 bytes * 34 column * 48 instance = 438086664192 bytes;
it's will cause the query canceled as not have enough memory.