JingsongLi commented on code in PR #760:
URL: https://github.com/apache/paimon-rust/pull/760#discussion_r3893386580


##########
crates/paimon/src/vindex/reader.rs:
##########
@@ -472,7 +472,7 @@ fn prepare_search(
         ),
     };
 
-    let filter_bytes = if let Some(include_ids) = 
&vector_search.include_row_ids {
+    let filter_bytes = if let Some(include_ids) = 
vector_search.effective_include_row_ids() {

Review Comment:
   [P2] Serialize a shared filter only once per batch
   
   The lateral path deliberately installs the same `Arc<Bitmap32>` on every 
query, but `prepare_search` serializes that bitmap separately for each query. 
The grouping below then compares the resulting `Vec<u8>` values byte-for-byte, 
so a batch of Q queries with a B-byte filter pays `O(Q×B)` allocation, 
serialization, and comparison even though the filter is shared.
   
   Please detect the shared `Arc` before preparing the searches (or cache the 
serialized bytes by Arc identity) and reuse one serialized payload/group. A 
batch test with a large shared bitmap would make the intended 
single-serialization behavior explicit.



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

Reply via email to