yiguolei commented on code in PR #65916:
URL: https://github.com/apache/doris/pull/65916#discussion_r3635859865
##########
be/src/storage/segment/segment_iterator.cpp:
##########
@@ -3647,5 +3647,47 @@ void
SegmentIterator::_prepare_score_column_materialization() {
std::shared_ptr<std::vector<uint64_t>>(std::move(result_row_ids)));
}
+void SegmentIterator::_update_score_query_limit() {
+ if (_score_runtime == nullptr) {
+ return;
+ }
+
+ DCHECK(_index_query_context != nullptr);
+ _index_query_context->query_limit =
+ _can_apply_score_query_limit() ? _score_runtime->get_limit() : 0;
+}
+
+bool SegmentIterator::_can_apply_score_query_limit() {
+ DCHECK(_score_runtime != nullptr);
+ if (_score_runtime->get_limit() == 0) {
+ return false;
+ }
+ if (_row_bitmap.cardinality() != num_rows()) {
+ return false;
+ }
+ if (!_opts.row_ranges.is_empty() || _has_delete_bitmap() ||
+ _opts.delete_condition_predicates->num_of_column_predicate() > 0 ||
+ !_opts.topn_filter_source_node_ids.empty() ||
!_opts.col_id_to_predicates.empty() ||
+ !_col_predicates.empty()) {
+ return false;
+ }
+ if (_common_expr_ctxs_push_down.size() != 1) {
Review Comment:
== 0 的时候是否可以?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]