lancedb / lance

Modern columnar data format for ML and LLMs implemented in Rust. Convert from parquet in 2 lines of code for 100x faster random access, vector index, and data versioning. Compatible with Pandas, DuckDB, Polars, Pyarrow, with more integrations coming..
https://lancedb.github.io/lance/
Apache License 2.0
3.73k stars 202 forks source link

page compaction after encoding #2571

Open broccoliSpicy opened 1 month ago

broccoliSpicy commented 1 month ago

For encodings like fsst, we store the decoding meta data in PageInfo.encoding, however, we may expect many decoding meta data in one page after compaction

broccoliSpicy commented 1 month ago

my another concern here is under the assumption that we want our write/read page size in align with the physical disk/cloud storage's optimal write/read size,

but we actually can't tell the output size of a encoding when we are issuing it

westonpace commented 1 month ago

We spoke in person (well, google meet) about this issue and here is my understanding:

Now that we have compressive encodings we need to worry about the difference between "decoded size" and "encoded size". Our current approach is "accumulate at least 8MB of decoded data, encode all data, write page" (the 8MB is configurable). If an encoding is very compressive then we might write small pages.

In addition, many encodings have a preferred "chunk size". For example, FSST creates a unique symbol table for each chunk. In Fastlanes style bitpacking/for/delta the authors operate in chunks of size 1024 rows (and each chunk may have a unique bit width).

I propose something like this:

broccoliSpicy commented 1 month ago

@westonpace ha, there are actually some comments related to this issue under #2563, nothing new that we haven't covered in the google meet though