···284284285285The `pair_count` records the number of pairs in the subtable,
286286which is needed to binary search the slot array.
287287+288288+## Memtables
289289+290290+A memtable is an in-memory table used to buffer writes before they are merged with the on-disk tables.
291291+There is one active memtable, which accepts writes and maintains sorted order.
292292+Once the active memtable grows large enough (64 MiB), it is frozen and a new active memtable is created.
293293+294294+Once enough memtables are accumulated (four), they are merged with the first level of the LSM on disk.
295295+296296+A memtable is implemented as an `:ets` table with the following layout:
297297+298298+```
299299+Key: {key, version}
300300+Value: value
301301+```
302302+303303+The `key` and `value` are binaries, and the `version` is the integer database version.