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-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org