yiguolei commented on code in PR #51271:
URL: https://github.com/apache/doris/pull/51271#discussion_r2108362908


##########
be/src/olap/rowset/beta_rowset_reader.cpp:
##########
@@ -221,6 +222,38 @@ Status 
BetaRowsetReader::get_segment_iterators(RowsetReaderContext* read_context
         _read_options.io_ctx.expiration_time = 0;
     }
 
+    if (config::enable_rowset_zone_map_cache) {
+        RETURN_IF_ERROR(_rowset->load_segments_info());
+        const auto& zone_maps = _rowset->get_zone_maps();
+        auto rowset_meta = _rowset->rowset_meta();
+        auto tablet_schema = rowset_meta->tablet_schema();
+        for (auto& col_to_predicate : _read_options.col_id_to_predicates) {
+            auto col_uid = col_to_predicate.first;
+            auto& predicate = col_to_predicate.second;
+
+            if (zone_maps.find(col_uid) == zone_maps.end()) {
+                continue;
+            }
+
+            const auto& zone_map = zone_maps.at(col_uid);
+            const auto& column_meta = tablet_schema->column_by_uid(col_uid);
+
+            auto colum_data_type = column_meta.get_vec_type();
+            if 
(!predicate->can_do_apply_safely(colum_data_type->get_primitive_type(),
+                                                
colum_data_type->is_nullable())) {
+                continue;
+            }
+
+            if (!ColumnReader::match_zone_map_condition(predicate.get(), 
column_meta.type(),
+                                                        column_meta.length(), 
zone_map)) {
+                LOG(INFO) << "rowset zone map match failed, col id: " << 
col_uid

Review Comment:
   这里日志可能会很多,所以不要打印日志了。
   我们需要加一个profile的counter。
   当前已经有一个counter,表示一共多少个segment,filter 了多少个。
   我们需要记录一下多少个rowset 被filter 了。



-- 
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

Reply via email to