Skip to content

docs: document chunk_size option and add a focused test#315

Open
BYK wants to merge 1 commit into
asg017:mainfrom
BYK:docs/chunk-size-option
Open

docs: document chunk_size option and add a focused test#315
BYK wants to merge 1 commit into
asg017:mainfrom
BYK:docs/chunk-size-option

Conversation

@BYK

@BYK BYK commented Jul 27, 2026

Copy link
Copy Markdown

The chunk_size vec0 table option was already supported and partially tested (the minimum chunk_size=8 path is exercised in test-loadable.py), but the public docs page at site/guides/performance.md only listed it as a chunk_size (?) stub.

This change:

  • Replaces the stub with a real API section covering the contract (default 1024, range 8..4096, divisible by 8, per-table, immutable after CREATE VIRTUAL TABLE), the tradeoffs (small chunk_size reduces empty-slot waste in sparse partitions; default fits dense corpora), and the error messages users will see for invalid values.
  • Adds a focused test for chunk_size=64 covering the 64-row boundary crossing, KNN correctness preservation vs. chunk_size=1024, and per-table shadow-table isolation when two vec0 tables with different chunk_size values coexist in the same database.

(I maintain Lore AI, which uses chunk_size=64 for temporal_vec to keep sparse project partitions from reserving megabytes — see #1499. Found that the option was useful but undocumented, so here is a writeup.)

The chunk_size vec0 table option was already supported and partially
tested (the minimum chunk_size=8 path is exercised in test-loadable.py),
but the public docs page at site/guides/performance.md only listed it
as a 'chunk_size (?)' stub.

This change:

- Replaces the stub with a real API section covering the contract
  (default 1024, range 8..4096, divisible by 8, per-table, immutable
  after CREATE VIRTUAL TABLE), the tradeoffs (small chunk_size reduces
  empty-slot waste in sparse partitions; default fits dense corpora),
  and the error messages users will see for invalid values.
- Adds a focused test for chunk_size=64 covering the 64-row boundary
  crossing, KNN correctness preservation vs. chunk_size=1024, and
  per-table shadow-table isolation when two vec0 tables with different
  chunk_size values coexist in the same database.
@BYK

BYK commented Jul 27, 2026

Copy link
Copy Markdown
Author

@asg017 - FYI this patch is LLM-generated that said I am not fire-and-forget. LMK if there are places you'd like me to change and I'd do that happily.

Thanks so much for sqlite-vec!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant