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

Idea: use bitmap instead of separate boolean columns in tuple table #348

Open
danielcompton opened this issue Oct 11, 2024 · 0 comments
Open

Comments

@danielcompton
Copy link

danielcompton commented Oct 11, 2024

I was looking at the schema for the triples table and saw a number of boolean columns. In Postgres, each column is stored as a byte, which costs 5 bytes for these flags:

  ea boolean NOT NULL,
  eav boolean NOT NULL,

  av boolean NOT NULL,
  ave boolean NOT NULL,

  vae boolean NOT NULL,

I wondered about converting these into a single flags column:

  flags char NOT NULL,

A char would only cost 1 byte, and would give you room for another 3 bit flags before you need to expand it to a 2-byte smallint. It looks like you would still be able to have partial indexes with bitfield calculations on the flags.

Just a thought, and a micro-optimization to save 4 bytes per triple, but I guess the triples will add up quickly!

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

No branches or pull requests

1 participant