lance-format / lance-format/lance
Zonemap index reading too many files
@HaochengLIU is already working on this.
Since Nov 4, 2025.
- Dominant language
- Rust
- Stars
- 7.1k
- Forks
- 852
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 272
Description
We have a dataset with a string column called test_id. The dataset has 30K fragments with each fragment having one test_id only for all rows. A simple query like
filter_expr = "test_id='50EA1PGA6SA001834_1751510023040761'"
# Create scanner with filter and stats
scanner = dataset.scanner(
filter=filter_expr
)
is scanning > 3k fragments instead of 1 so this query is running very slowly.
[90m[[0m2025-11-03T21:47:06Z [34mDEBUG[0m lance_datafusion::exec[90m][0m Executing plan:
LanceRead: uri=xx, projection=[redacted], num_fragments=33010, range_before=None, range_after=None, row_id=false, row_addr=false, full_filter=test_id = Utf8("50EA1PGA6SA001834_1751510023040761"), refine_filter=--
ScalarIndexQuery: query=[test_id = 50EA1PGA6SA001834_1751510023040761]@test_id_idx
From the trace logs i confirmed that zonemap index was used and the fragment 71 which had this data
[90m[[0m2025-11-03T21:47:08Z [36mTRACE[0m lance::io::exec::filtered_read[90m][0m Planning 1 ranges (3480 rows) from fragment 71 with filter: Some(BinaryExpr(BinaryExpr { left: Column(Column { relation: None, name: "test_id" }), op: Eq, right: Literal(Utf8("50EA1PGA6SA001834_1751510023040761"), None) }))
was correctly read. However other fragments were read too which don't have that data.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.