-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mito: Null value should also contribute to memtable usage #3221
Comments
I wonder if we can do a quick fix. |
@evenyag what will be the size of a single |
It depends on the data type and the arrow array's implementation. Primitive arrays always push a default value into the data buffer so it occupies the same space as the native type. BinaryArray and StringArray also push an offset into the offset buffer so the size is the size of the offset type. I ignore the size of the null bitmap and buffer padding for simplicity. It's hard to maintain the correct memory usage of the memtable via accumulating |
What type of enhancement is this?
Other
What does the enhancement do?
Now the
ValueRef
always considers null as zero sizegreptimedb/src/datatypes/src/value.rs
Lines 1172 to 1174 in 19413eb
The memtable uses
ValueRef::data_size()
to compute the allocated size, which is incorrect if there are too many nulls.greptimedb/src/mito2/src/memtable/time_series.rs
Line 194 in 19413eb
The arrow array allocates space for nulls.
Implementation challenges
We might assume nulls occupy spaces or find a new way to estimate the memory used by array builders.
The text was updated successfully, but these errors were encountered: