File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,9 @@ impl MemBuffer {
230230 {
231231 for bucket_entry in table. buckets . iter ( ) {
232232 if let Ok ( batches) = bucket_entry. batches . read ( ) {
233- // RecordBatch uses Arc internally - clone is O(columns), not O(data)
233+ // RecordBatch clone is cheap: Arc<Schema> + Vec<Arc<Array>>
234+ // Only clones pointers (~100 bytes/batch), NOT the underlying data
235+ // A 4GB buffer query adds ~1MB overhead, not 4GB
234236 results. extend ( batches. iter ( ) . cloned ( ) ) ;
235237 }
236238 }
@@ -258,7 +260,7 @@ impl MemBuffer {
258260 && let Ok ( batches) = bucket. batches . read ( )
259261 && !batches. is_empty ( )
260262 {
261- // RecordBatch uses Arc internally - clone is O(columns ), not O( data)
263+ // RecordBatch clone is cheap (~100 bytes/batch ), data is Arc-shared
262264 partitions. push ( batches. clone ( ) ) ;
263265 }
264266 }
You can’t perform that action at this time.
0 commit comments