Discussion:
Big leaf nodes in LMDBv2
Hallvard Breien Furuseth
2015-09-24 08:33:52 UTC
Permalink
Content preview: LMDBv1 supports 1-node leaf pages so it can split a 2-node
leaf to make room for a 3rd node. (ITS#8237). LMDBv2 could extend this, to
use fewer pages: Allow oversized leaf nodes. mdb_cursor_put() won't create
ovpages directly, but call page_split() which instead of splitting may kick
an oversized node and/or the new node out to an ovpage. Usually only the
biggest of the two. To assist page_split(), give such leaf pages a flag P_HAS_BIGNODE
and set mp_pad = size of the biggest oversized node. That gets a bit simpler
if we allow only 1 oversized node per leaf. [...]

Content analysis details: (-4.2 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
-2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium
trust
[129.240.10.17 listed in list.dnswl.org]
-0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay
domain
-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
[score: 0.0000]

LMDBv1 supports 1-node leaf pages so it can split a 2-node leaf to
make room for a 3rd node. (ITS#8237).

LMDBv2 could extend this, to use fewer pages: Allow oversized leaf
nodes. mdb_cursor_put() won't create ovpages directly, but call
page_split() which instead of splitting may kick an oversized node
and/or the new node out to an ovpage. Usually only the biggest of
the two. To assist page_split(), give such leaf pages a flag
P_HAS_BIGNODE and set mp_pad = size of the biggest oversized node.
That gets a bit simpler if we allow only 1 oversized node per leaf.

The inverse fix is "a page has room for 3 nodes". This reduces
me_nodemax from 2038 1358, max supported MDB_MAXKEYSIZE from 1982
to 1302, and uses more ovpages. Add mdb_env_set_pagesize() so
LMDBv2 with bigger pages can reload an LMDBv1 DB with big keys.

Hallvard

Loading...