mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-12 01:42:53 -05:00
ITS#9806 LMDB page_split: key threshold depends on page size
32 was chosen for page size of 4KB. Not large nough for 16KB pages.
This commit is contained in:
parent
d87d682b6d
commit
d2fa5806d8
1 changed files with 6 additions and 2 deletions
|
|
@ -8737,9 +8737,13 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno
|
|||
mc->mc_ki[mc->mc_top] = x;
|
||||
}
|
||||
} else {
|
||||
int psize, nsize, k;
|
||||
int psize, nsize, k, keythresh;
|
||||
|
||||
/* Maximum free space in an empty page */
|
||||
pmax = env->me_psize - PAGEHDRSZ;
|
||||
/* Threshold number of keys considered "small" */
|
||||
keythresh = env->me_psize >> 7;
|
||||
|
||||
if (IS_LEAF(mp))
|
||||
nsize = mdb_leaf_size(env, newkey, newdata);
|
||||
else
|
||||
|
|
@ -8780,7 +8784,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno
|
|||
* the split so the new page is emptier than the old page.
|
||||
* This yields better packing during sequential inserts.
|
||||
*/
|
||||
if (nkeys < 32 || nsize > pmax/16 || newindx >= nkeys) {
|
||||
if (nkeys < keythresh || nsize > pmax/16 || newindx >= nkeys) {
|
||||
/* Find split point */
|
||||
psize = 0;
|
||||
if (newindx <= split_indx || newindx >= nkeys) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue