zhangyue-hashdata commented on code in PR #724:
URL: https://github.com/apache/cloudberry/pull/724#discussion_r1869401110


##########
src/backend/executor/nodeSeqscan.c:
##########
@@ -87,8 +101,17 @@ SeqNext(SeqScanState *node)
        /*
         * get the next tuple from the table
         */
-       if (table_scan_getnextslot(scandesc, direction, slot))
+       while (table_scan_getnextslot(scandesc, direction, slot))
+       {
+               if (TupIsNull(slot))
+                       return slot;
+
+               if (node->filter_in_seqscan && node->filters &&
+                       !PassByBloomFilter(node, slot))

Review Comment:
   **Similarities:**
   In this feature, the creation and testing of the Bloom filter use the same 
implementation as that of the gp_enable_runtime_filter feature.
   
   **Differences:**
   
   - The gp_enable_runtime_filter feature decides during the optimizer phase 
whether to use a Bloom filter to filter data. It inserts the functionality of 
filtering data with a Bloom filter as an nodeRuntimeFilter node into the left 
subtree of a Hash Join.
   
   - In contrast, this new feature does not insert an node. Instead, it 
directly pushes down the Bloom filter and other filters to the SeqScan or even 
the Access Method (AM), applying the filters closer to where the data is 
generated. This approach enhances filtering efficiency compared to 
gp_enable_runtime_filter.
   
   By pushing the filters closer to the data source, this new method achieves 
more efficient data filtering before the data reaches higher-level operators, 
potentially reducing the amount of data that needs to be processed by 
subsequent operations in the query execution plan.



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

Reply via email to