@@ -263,8 +263,6 @@ SegmentIterator::SegmentIterator(std::shared_ptr<Segment> segment, SchemaSPtr sc
263263 _lazy_materialization_read(false ),
264264 _lazy_inited(false ),
265265 _inited(false ),
266- _estimate_row_size(true ),
267- _wait_times_estimate_row_size(10 ),
268266 _pool(new ObjectPool) {}
269267
270268Status SegmentIterator::init (const StorageReadOptions& opts) {
@@ -2167,13 +2165,6 @@ Status SegmentIterator::_next_batch_internal(vectorized::Block* block) {
21672165
21682166 _current_batch_rows_read = 0 ;
21692167 uint32_t nrows_read_limit = _opts.block_row_max ;
2170- if (_wait_times_estimate_row_size > 0 ) {
2171- // first time, read 100 rows to estimate average row size, to avoid oom caused by a single batch being too large.
2172- // If no valid data is read for the first time, block_row_max is read each time thereafter.
2173- // Avoid low performance when valid data cannot be read all the time
2174- nrows_read_limit = std::min (nrows_read_limit, (uint32_t )100 );
2175- _wait_times_estimate_row_size--;
2176- }
21772168 RETURN_IF_ERROR (_read_columns_by_index (
21782169 nrows_read_limit, _current_batch_rows_read,
21792170 _lazy_materialization_read || _opts.record_rowids || _is_need_expr_eval));
@@ -2320,9 +2311,6 @@ Status SegmentIterator::_next_batch_internal(vectorized::Block* block) {
23202311 // shrink char_type suffix zero data
23212312 block->shrink_char_type_column_suffix_zero (_char_type_idx);
23222313
2323- if (UNLIKELY (_estimate_row_size) && block->rows () > 0 ) {
2324- _update_max_row (block);
2325- }
23262314 return Status::OK ();
23272315 }
23282316 // step4: read non_predicate column
@@ -2358,10 +2346,6 @@ Status SegmentIterator::_next_batch_internal(vectorized::Block* block) {
23582346 }
23592347#endif
23602348
2361- if (UNLIKELY (_estimate_row_size) && block->rows () > 0 ) {
2362- _update_max_row (block);
2363- }
2364-
23652349 // reverse block row order
23662350 if (_opts.read_orderby_key_reverse ) {
23672351 size_t num_rows = block->rows ();
@@ -2515,15 +2499,6 @@ void SegmentIterator::_convert_dict_code_for_predicate_if_necessary_impl(
25152499 }
25162500}
25172501
2518- void SegmentIterator::_update_max_row (const vectorized::Block* block) {
2519- _estimate_row_size = false ;
2520- auto avg_row_size = block->bytes () / block->rows ();
2521- if (avg_row_size > 0 ) {
2522- int block_row_max = config::doris_scan_block_max_mb / avg_row_size;
2523- _opts.block_row_max = std::min (block_row_max, _opts.block_row_max );
2524- }
2525- }
2526-
25272502Status SegmentIterator::current_block_row_locations (std::vector<RowLocation>* block_row_locations) {
25282503 DCHECK (_opts.record_rowids );
25292504 DCHECK_GE (_block_rowids.size (), _current_batch_rows_read);
0 commit comments