mirror of
https://github.com/lancedb/lancedb.git
synced 2026-10-13 15:22:30 +00:00
_TwoPhaseSplitReader now schedules background fetches for the next few not-yet-loaded blocks the read plan is about to need, via a small private ThreadPoolExecutor sized by prefetch_depth (wired to io_queue_depth). A later __getitems__ call usually finds the block already fetched instead of blocking on storage, overlapping this split's own I/O with whatever is consuming its previous blocks -- the same benefit io_queue_depth already gives 1-phase, now extended inside a single 2-phase split too. Each reader's executor is shut down via a new close() method, called from _iter_owned's cleanup (and _estimate_blocks_per_epoch's sampling loop) since a fresh set of readers is built on every iteration.