You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/08/31 03:57:52 UTC
[GitHub] [doris] yixiutt opened a new pull request, #12214: [Improvement](compaction) copy row in batch in VCollectIterator&VGenericIterator
yixiutt opened a new pull request, #12214:
URL: https://github.com/apache/doris/pull/12214
In VCollectIterator&VGenericIterator, use insert_range_from to copy rows
in a block which is continuous to save cpu cost.
If rows in rowset and segment are non overlapping, this whill improve 30%
throughput of compaction.If rows are completely overlapping such as load two
same files, the throughput goes nearly same as before.
# Proposed changes
Issue Number: close #xxx
## Problem summary
Describe your changes.
## Checklist(Required)
1. Does it affect the original behavior:
- [ ] Yes
- [ ] No
- [ ] I don't know
2. Has unit tests been added:
- [ ] Yes
- [ ] No
- [ ] No Need
3. Has document been added or modified:
- [ ] Yes
- [ ] No
- [ ] No Need
4. Does it need to update dependencies:
- [ ] Yes
- [ ] No
5. Are there any changes that cannot be rolled back:
- [ ] Yes (If Yes, please explain WHY)
- [ ] No
## Further comments
If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] BiteTheDDDDt merged pull request #12214: [Improvement](compaction) copy row in batch in VCollectIterator&VGenericIterator
Posted by GitBox <gi...@apache.org>.
BiteTheDDDDt merged PR #12214:
URL: https://github.com/apache/doris/pull/12214
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] BiteTheDDDDt commented on a diff in pull request #12214: [Improvement](compaction) copy row in batch in VCollectIterator&VGenericIterator
Posted by GitBox <gi...@apache.org>.
BiteTheDDDDt commented on code in PR #12214:
URL: https://github.com/apache/doris/pull/12214#discussion_r959372783
##########
be/src/vec/olap/vgeneric_iterators.cpp:
##########
@@ -382,21 +399,36 @@ Status VMergeIterator::next_batch(vectorized::Block* block) {
_block_row_locations.resize(block_row_max);
}
size_t row_idx = 0;
+ VMergeIteratorContext* pre_ctx = nullptr;
while (block->rows() < block_row_max) {
if (_merge_heap.empty()) break;
auto ctx = _merge_heap.top();
_merge_heap.pop();
if (!ctx->need_skip()) {
- // copy current row to block
- ctx->copy_row(block);
+ ctx->add_cur_batch();
+ if (pre_ctx != ctx) {
+ if (pre_ctx) {
Review Comment:
same problem
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] yixiutt commented on a diff in pull request #12214: [Improvement](compaction) copy row in batch in VCollectIterator&VGenericIterator
Posted by GitBox <gi...@apache.org>.
yixiutt commented on code in PR #12214:
URL: https://github.com/apache/doris/pull/12214#discussion_r959523694
##########
be/src/vec/olap/vgeneric_iterators.cpp:
##########
@@ -382,21 +399,36 @@ Status VMergeIterator::next_batch(vectorized::Block* block) {
_block_row_locations.resize(block_row_max);
}
size_t row_idx = 0;
+ VMergeIteratorContext* pre_ctx = nullptr;
while (block->rows() < block_row_max) {
if (_merge_heap.empty()) break;
auto ctx = _merge_heap.top();
_merge_heap.pop();
if (!ctx->need_skip()) {
Review Comment:
need_skip is set in Comparator and it's used for every row
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] kpfly commented on pull request #12214: [Improvement](compaction) copy row in batch in VCollectIterator&VGenericIterator
Posted by GitBox <gi...@apache.org>.
kpfly commented on PR #12214:
URL: https://github.com/apache/doris/pull/12214#issuecomment-1232458821
@Gabriel39 @BiteTheDDDDt Could you guys review this please
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] yixiutt commented on a diff in pull request #12214: [Improvement](compaction) copy row in batch in VCollectIterator&VGenericIterator
Posted by GitBox <gi...@apache.org>.
yixiutt commented on code in PR #12214:
URL: https://github.com/apache/doris/pull/12214#discussion_r959543223
##########
be/src/vec/olap/vgeneric_iterators.cpp:
##########
@@ -382,21 +399,36 @@ Status VMergeIterator::next_batch(vectorized::Block* block) {
_block_row_locations.resize(block_row_max);
}
size_t row_idx = 0;
+ VMergeIteratorContext* pre_ctx = nullptr;
while (block->rows() < block_row_max) {
if (_merge_heap.empty()) break;
auto ctx = _merge_heap.top();
_merge_heap.pop();
if (!ctx->need_skip()) {
- // copy current row to block
- ctx->copy_row(block);
+ ctx->add_cur_batch();
+ if (pre_ctx != ctx) {
+ if (pre_ctx) {
Review Comment:
add a row_idx check below
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] Gabriel39 commented on a diff in pull request #12214: [Improvement](compaction) copy row in batch in VCollectIterator&VGenericIterator
Posted by GitBox <gi...@apache.org>.
Gabriel39 commented on code in PR #12214:
URL: https://github.com/apache/doris/pull/12214#discussion_r959194685
##########
be/src/vec/olap/vgeneric_iterators.cpp:
##########
@@ -382,21 +399,36 @@ Status VMergeIterator::next_batch(vectorized::Block* block) {
_block_row_locations.resize(block_row_max);
}
size_t row_idx = 0;
+ VMergeIteratorContext* pre_ctx = nullptr;
while (block->rows() < block_row_max) {
if (_merge_heap.empty()) break;
auto ctx = _merge_heap.top();
_merge_heap.pop();
if (!ctx->need_skip()) {
Review Comment:
Is it possible to have different `need_skip` in a `VMergeIterator `? If all of `ctx` in each `VMergeIterator` is `need_skip` or not `need_skip`, maybe we should move this condition out of this while-loop
##########
be/src/vec/olap/vgeneric_iterators.cpp:
##########
@@ -382,21 +399,36 @@ Status VMergeIterator::next_batch(vectorized::Block* block) {
_block_row_locations.resize(block_row_max);
}
size_t row_idx = 0;
+ VMergeIteratorContext* pre_ctx = nullptr;
while (block->rows() < block_row_max) {
if (_merge_heap.empty()) break;
auto ctx = _merge_heap.top();
Review Comment:
We should make this comparison inside one block as much as possible instead of always using a heap to compare rows between different blocks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] yixiutt commented on a diff in pull request #12214: [Improvement](compaction) copy row in batch in VCollectIterator&VGenericIterator
Posted by GitBox <gi...@apache.org>.
yixiutt commented on code in PR #12214:
URL: https://github.com/apache/doris/pull/12214#discussion_r959542775
##########
be/src/vec/olap/vcollect_iterator.cpp:
##########
@@ -470,7 +479,32 @@ Status VCollectIterator::Level1Iterator::_merge_next(Block* block) {
LOG(WARNING) << "next failed: " << res;
return res;
}
- } while (target_block_row < _batch_size);
+ if (target_block_row >= _batch_size) {
Review Comment:
target_block_row must be less than batch_size
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] BiteTheDDDDt commented on a diff in pull request #12214: [Improvement](compaction) copy row in batch in VCollectIterator&VGenericIterator
Posted by GitBox <gi...@apache.org>.
BiteTheDDDDt commented on code in PR #12214:
URL: https://github.com/apache/doris/pull/12214#discussion_r959370964
##########
be/src/vec/olap/vcollect_iterator.cpp:
##########
@@ -470,7 +479,32 @@ Status VCollectIterator::Level1Iterator::_merge_next(Block* block) {
LOG(WARNING) << "next failed: " << res;
return res;
}
- } while (target_block_row < _batch_size);
+ if (target_block_row >= _batch_size) {
Review Comment:
Maybe we should limit a batch not over batch_size
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #12214: [Improvement](compaction) copy row in batch in VCollectIterator&VGenericIterator
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #12214:
URL: https://github.com/apache/doris/pull/12214#issuecomment-1233022910
PR approved by at least one committer and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #12214: [Improvement](compaction) copy row in batch in VCollectIterator&VGenericIterator
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #12214:
URL: https://github.com/apache/doris/pull/12214#issuecomment-1233022953
PR approved by anyone and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org