Skip to content

Commit fab98af

Browse files
Turn on parallelism in tile fetching.
1 parent 2b93974 commit fab98af

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/duckdb_data.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,19 @@ impl<T: DeferredDataSource> DataSourceDuckDBWriter<T> {
371371
.fetch_slot_meta_tile(entry_id, *tile_id, FULL);
372372
}
373373

374-
while self.data_source.outstanding_requests() > 0 {
374+
const MAX_IN_FLIGHT_REQUESTS: u64 = 100;
375+
376+
while self.data_source.outstanding_requests() > MAX_IN_FLIGHT_REQUESTS {
375377
self.write_slot_meta_tiles(&conn, &info.field_schema, &entry_id_slugs, &mut tables)
376378
.expect("creating slot meta table failed");
377379
}
378380
}
379381

382+
while self.data_source.outstanding_requests() > 0 {
383+
self.write_slot_meta_tiles(&conn, &info.field_schema, &entry_id_slugs, &mut tables)
384+
.expect("creating slot meta table failed");
385+
}
386+
380387
Ok(())
381388
}
382389
}

0 commit comments

Comments
 (0)