Skip to content
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

Compact Storage #26

Open
pmenon opened this issue Jun 4, 2020 · 0 comments
Open

Compact Storage #26

pmenon opened this issue Jun 4, 2020 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@pmenon
Copy link
Owner

pmenon commented Jun 4, 2020

Materializing sql::Val into memory is inefficient due to its layout. Because the null indicator byte is stored before the type-specific data, larger SQL types (e.g., ints and big ints) require a 3-byte and 7-byte padding. This wasted space effectively doubles the size of these types. Thus, hash-tables and sorters can effectively halve their size by using a more efficient layout.

What we need is a Storage responsible with converting sql::Val used during query processing into a compact form when writing to memory. Ideally, Storage is instantiated with a
schema a priori, and determines an optimal alignment to minimize wasted space. A simple approach is to sort by data type size with a NULL bitmap tacked onto the end.

@pmenon pmenon added the enhancement New feature or request label Jun 4, 2020
@pmenon pmenon added this to the v1.0 milestone Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant