nextdreamblue commented on code in PR #17146:
URL: https://github.com/apache/doris/pull/17146#discussion_r1118368755


##########
be/src/olap/rowset/segment_v2/segment_iterator.cpp:
##########
@@ -379,7 +379,15 @@ Status 
SegmentIterator::_get_row_ranges_from_conditions(RowRanges* condition_row
         DCHECK(_opts.col_id_to_predicates.count(cid) > 0);
         
RETURN_IF_ERROR(_column_iterators[_schema.unique_id(cid)]->get_row_ranges_by_zone_map(
                 _opts.col_id_to_predicates[cid].get(),
-                _opts.col_id_to_del_predicates.count(cid) > 0
+                // 理论上,如果是两次独立的删除,比如delete from table where a=1; delete from 
table where a=2;其实这个地方应该可以使用的;
+                // 但是目前的代码,是把所有不同版本的delete predicates和不同列的delete 
predicates都放到一起了,失去了版本信息、失去了谓词间可能是and的关系,
+                // 统一弱化成了delete predicates都是独立的,有一个delete 
predicates满足条件,就把page都去掉。
+                // 这个pr的修改方式,就是在当前代码的基础上,当只有一个delete 
predicate的时候才能保证后续淘汰page的正确性,所以这里一律加了 == 1的判断才传递delete predicates。
+                // 如果要把不同版本的delete predicates和不同列的delete 
predicates作为完整和严谨的逻辑去判断page,需要修改的设计就有点多了,
+                // 目前的方案算是一种优先解决bug的思路,后续可以进一步把delete 
predicates这块加速zone判断进行page淘汰的逻辑完善,提高delete predicates使用的场景。

Review Comment:
   > Please compact the comment and in English. For example:
   > 
   > ```
   > Currently, one transaction can only support one delete condition for page 
filtering.
   > Following case is allowed:
   > delete from table1 where a=1;
   > delete from table1 where a=2;
   > Following case is not allowed, because one transaction has more than on 
delete condition:
   > delete from table1 where a=1 and b = 2;
   > This may cause bug when you query table1 with a=1;
   > You can refer #17145 for more details.
   > ```
   
   thanks bro, you are my hero



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