zhiqiang-hhhh commented on code in PR #57623:
URL: https://github.com/apache/doris/pull/57623#discussion_r2508954538
##########
be/src/olap/rowset/segment_v2/ann_index/ann_index_writer.cpp:
##########
@@ -76,6 +76,12 @@ Status AnnIndexColumnWriter::init() {
"ef_construction {}, quantizer {}",
index_type, build_parameter.dim, metric_type,
build_parameter.max_degree,
build_parameter.ef_construction, quantizer);
+
+ size_t block_size = CHUNK_SIZE * build_parameter.dim;
+ // The array capacity will not change after resizing
+ _float_array.resize(block_size);
Review Comment:
reserve instead of resize
##########
be/src/olap/rowset/segment_v2/ann_index/ann_index_writer.cpp:
##########
@@ -76,6 +76,12 @@ Status AnnIndexColumnWriter::init() {
"ef_construction {}, quantizer {}",
index_type, build_parameter.dim, metric_type,
build_parameter.max_degree,
build_parameter.ef_construction, quantizer);
+
+ size_t block_size = CHUNK_SIZE * build_parameter.dim;
+ // The array capacity will not change after resizing
+ _float_array.resize(block_size);
+ _array_offset = 0;
Review Comment:
_array_offset is not needed
--
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]