TsukiokaKogane commented on code in PR #66849:
URL: https://github.com/apache/doris/pull/66849#discussion_r3801775473
##########
be/src/storage/iterator/block_reader.cpp:
##########
@@ -95,6 +110,10 @@ Status BlockReader::_ensure_binlog_column_pos(const Block&
src_block) {
const uint32_t col_num = src_block.columns();
_before_column_idx.resize(col_num);
+ std::iota(_before_column_idx.begin(), _before_column_idx.end(), 0);
+ std::vector<bool> is_before_value_column(col_num, false);
Review Comment:
新增两处宽表 O(C²) 初始化
[olap_scanner.cpp:506](https://github.com/apache/doris/blob/56a134171dca2848291e92b4a733c0ed9e63967a/be/src/exec/scan/olap_scanner.cpp#L506):为每列执行一次
std::find。
[block_reader.cpp:124](https://github.com/apache/doris/blob/56a134171dca2848291e92b4a733c0ed9e63967a/be/src/storage/iterator/block_reader.cpp#L124):为每列调用一次线性
get_position_by_name()。
应使用 dense bitmap/hash set 维护已选择列,并一次性构造名称或 ordinal 映射,把两处降为 O(C)。
建议优化一下 宽表 O(C²) 初始化的部分
--
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]