github-actions[bot] commented on code in PR #67915:
URL: https://github.com/apache/doris/pull/67915#discussion_r4356704919


##########
be/src/exec/operator/olap_scan_operator.cpp:
##########
@@ -835,15 +861,7 @@ Status 
OlapScanLocalState::_init_scanners(std::list<ScannerSPtr>* scanners) {
         scanner_builder.set_min_rows_per_scanner(min_rows_per_scanner);
         // BM25 statistics must not depend on how a tablet is split into 
scanners.
         scanner_builder.set_share_tablet_collection_statistics(_score_runtime 
!= nullptr);
-        // If the session variable is set, force one scanner per segment.
-        if (state()->query_options().__isset.optimize_index_scan_parallelism &&
-            state()->query_options().optimize_index_scan_parallelism) {
-            // TODO: Use optimize_index_scan_parallelism for ann range search 
in the future.
-            // Currently, ann topn is enough
-            if (_ann_topn_runtime != nullptr) {
-                scanner_builder.set_scan_parallelism_by_per_segment(true);
-            }
-        }
+        
scanner_builder.set_scan_parallelism_by_per_segment(_use_scan_parallelism_by_per_segment());

Review Comment:
   [P2] Restrict delete-bitmap setup to the scanner's segment range
   
   For a cloud UNIQUE KEY MoW table with an S-segment rowset that previously 
fit in one row-based scanner, this new MATCH route creates S cloned 
BetaRowsetReaders. BetaRowsetReader::get_segment_iterators() 
(beta_rowset_reader.cpp:165-179) calls get_agg() for all S rowset segments 
before applying _segment_offsets, so the query now performs S^2 delete-bitmap 
cache lookups and rebuilds each reader's map of nonempty bitmaps. Cache hits 
and running concurrency of 1 still incur that quadratic setup. Restrict bitmap 
collection to the assigned segment range, or share the rowset-wide setup, 
before selecting this path by default. This is distinct from the existing 
scanner-cap thread: this repeated work occurs inside admitted reader 
initialization, and bitmap contents themselves remain cache-shared.



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