zhannngchen commented on code in PR #45287: URL: https://github.com/apache/doris/pull/45287#discussion_r1895342845
########## be/src/olap/rowset/rowset_meta.cpp: ########## @@ -220,6 +220,28 @@ int64_t RowsetMeta::segment_file_size(int seg_id) { : -1; } +void RowsetMeta::set_segments_key_bounds(const std::vector<KeyBoundsPB>& segments_key_bounds) { + for (const KeyBoundsPB& key_bounds : segments_key_bounds) { + KeyBoundsPB* new_key_bounds = _rowset_meta_pb.add_segments_key_bounds(); + *new_key_bounds = key_bounds; + } + + bool truncated {config::enable_segments_key_bounds_truncation && + config::segments_key_bounds_truncation_threshold > 0}; + set_segments_key_bounds_truncated(truncated); Review Comment: You should set this filed to `true` only if the keybounds is actrually truncated? ########## be/src/olap/base_tablet.h: ########## @@ -146,7 +146,8 @@ class BaseTablet { RowsetSharedPtr rowset, const TupleDescriptor* desc, OlapReaderStatistics& stats, std::string& values, bool write_to_cache = false); - + bool key_is_not_in_segment(Slice key, const KeyBoundsPB& segment_key_bounds, Review Comment: Oh, I see. You can only confirm that the key is not in this segment, but you cannot confirm that it is in the segment. You need to add comment for this method. -- 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