Repository navigation
Conversation
… config Add two dataset config keys. `lance.zone_write_seeds.enabled` makes writes embed a zone map seed for every top-level column of a supported scalar type that no seeded ZoneMap index covers, so a ZoneMap index created later can be built from seeds instead of scanning. `lance.zone_write_seeds.rows_per_zone` sets the rows per seed zone for those columns (default 8192). A column with a seeded ZoneMap index keeps following that index. The commit that enables the setting also sets the seed feature flags; binary-copy compaction declares the same zone size for carried seeds. Co-Authored-By: Claude <noreply@anthropic.com>
Reject an invalid lance.zone_write_seeds.* value in the commit that sets it, as the auto-cleanup keys are validated, instead of falling back on later writes. Add lifecycle, per-type round-trip and binary-copy carry tests. Co-Authored-By: Claude <noreply@anthropic.com>
|
Zone statistics have no min/max for fixed-size binary, so a seed for such a column is always rejected by the index build. Also check unseeded nested columns in the test through every file of the fragment. Co-Authored-By: Claude <noreply@anthropic.com>
Check the final manifest once after all actions, as the auto-cleanup settings are checked. Assert seed reuse in the binary-copy carry test and add value predicates to the per-type round trip. Co-Authored-By: Claude <noreply@anthropic.com>
A Lance field stores view types as their base string or binary type, so the case asserted on a type the gate never sees. Co-Authored-By: Claude <noreply@anthropic.com>
Add lance.zone_write_seeds.store_null_bitmap (default true) so seeds collected from the dataset config can serve a zone map that stores a null bitmap. Co-Authored-By: Claude <noreply@anthropic.com>
Adds a matrix over seed size, index size, fragment length and batch size that checks which fragments are reused, partly scanned or scanned, and compares indexed results row by row with the generator and an unindexed scan. Co-Authored-By: Claude <noreply@anthropic.com>
A partly reused fragment is reported as both partial and scanned, and scanned rows include the unseeded creating fragment. Corrects the expectation for 8-row records over 20-row index zones. Co-Authored-By: Claude <noreply@anthropic.com>
Asserts the exact outcome for a seed coarser than the index and adds 8192 and 1,000,000-row zone sizes over a fragment length neither divides. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Reads every persisted zone of the index built from configured seeds and checks its span, bounds and null count against values computed from the generator, including the unseeded creating fragment and short final zones. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…ndex Checks reuse, stored zone statistics and query results for integer, float, string, timestamp, boolean and decimal columns where reused and scanned zones mix. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Zone map write seeds are collected today only for columns that already have a ZoneMap index with
use_seeds = true. Data written before such an index exists carries no seed, so the first index build (and every build over older fragments) scans the column.This PR adds a dataset-level switch so that writes embed seeds for scalar columns that have no seeded ZoneMap index yet. A ZoneMap built later on such a column reuses the seeds instead of scanning.
Dataset config
Set with
Dataset::update_config; all three are validated in the commit that sets them (legacyUpdateConfig/Overwriteand the composite action path), the same way thelance.auto_cleanup.*keys are.lance.zone_write_seeds.enabled"true"/"false"lance.zone_write_seeds.rows_per_zone1..=u32::MAXlance.zone_write_seeds.store_null_bitmap"true"/"false"Unknown keys under the
lance.zone_write_seeds.prefix are rejected. A value already present in a manifest written by a build without validation is read leniently (warning and default).Behaviour
rows_per_zonewhen there are several, and the indexes' null-bitmap policy). The dataset config does not change it.rows_per_zonewhen the setting is on. A ZoneMap index withuse_seeds = falsedoes not suppress it.FLAG_ZONE_WRITE_SEEDSin that commit. Writes based on an earlier version stay unseeded, as before.rows_per_zoneapplies to later files; older files keep their records.index_rows_per_zonenow considers only indexes withuse_seeds = trueand takes their minimum; previously the last ZoneMap index of any kind won.store_null_bitmap = falsea configured seed records null counts only and serves ZoneMaps created withstore_null_bitmap = false. With the default it serves both kinds.Limitations
Tests
use_seeds = falseindex.trueserve an index with and without a null bitmap;falsefalls back to a scan for a bitmap index.Measurements
Single-column tables, 100M rows appended in one call to local NVMe (1M rows per file), same binary and identical pre-generated data for every arm, 3 repetitions, median.
aarch64, 16 cores. Index: ZoneMap withrows_per_zone = 1,000,000.Append wall time relative to the setting off, 2% nulls at random positions:
The absolute cost for narrow types is 2 to 7 ns per row; the percentage is high because writing a narrow column to local disk is itself very cheap. Seed size 8192 instead of 1,000,000 adds a few percentage points.
Null positions, int64, by null fraction (random positions, the worst case for the bitmap):
A ZoneMap that stores a null bitmap builds from seeds with positions in 0.034 s (2% nulls) and 0.084 s (30%) instead of 0.41 s and 0.47 s by scan; seeds without positions cannot serve it. Peak RSS showed no difference between arms. Every arm verified the committed config, both feature-flag words and the presence of the seed in each appended file before timing, and compared filtered counts with and without the index afterwards.
🤖 Generated with Claude Code