speedb-io / speedb

A RocksDB compliant high performance scalable embedded key-value store
https://www.speedb.io/
Apache License 2.0
882 stars 65 forks source link

Use less memtables for the entire db, reserved for switch memtable #779

Open ofriedma opened 9 months ago

ofriedma commented 9 months ago

Currently for each CF, we reserve a spare memtable waiting to replace the active one, we could reserve it for the entire db so we will be able to save some memory

udi-speedb commented 9 months ago

@ofriedma -

  1. I assume this issue is applicable to Speedb's memtables only. Am I right?
  2. How much memory does a single empty memtable consume?
ofriedma commented 9 months ago
  1. No, for all implementations
  2. Didn't investigate it has it's still under future to research - it depends on the memtable itself
ayulas commented 8 months ago

its completely not correct. this was the propose of doing the global switch #296 the prepare switch memtable is done on a memtable factory, and only on a factory that support that - e.g. enable_switchmemtable is true. so it means that if all the cfs use the same factory ,this is on entire db.... currently only hash spdb memtable uses it