By default, a full data flush/sync is performed when each
transaction is committed.
.TP
+.B dbpagesize \ <bytes>
+Specify the page size to use for the database, in bytes. The default
+depends on the underlying filesystem's block size (typically 4096 or 8192).
+The value must be a power of two and the maximum is 65536.
+This setting usually should not need to be changed,
+but setting a larger pagesize also increases the maximum length of keys
+so it may be useful to support longer values when \fBmultival\fP is used.
+This setting only takes effect when a database is being newly created.
+.TP
.BI directory \ <directory>
Specify the directory where the LMDB files containing this database and
associated indexes live.
"DESC 'Disable synchronous database writes' "
"EQUALITY booleanMatch "
"SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
+ { "dbpagesize", "size", 2, 2, 0, ARG_UINT|ARG_OFFSET,
+ (void *)offsetof(struct mdb_info, mi_pagesize),
+ "( OLcfgDbAt:1.15 NAME 'olcDbPageSize' "
+ "DESC 'Page size in bytes, in range 256-65536' "
+ "EQUALITY integerMatch "
+ "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
{ "envflags", "flags", 2, 0, 0, ARG_MAGIC|MDB_ENVFLAGS,
mdb_cf_gen, "( OLcfgDbAt:12.3 NAME 'olcDbEnvFlags' "
"DESC 'Database environment flags' "
"MAY ( olcDbCheckpoint $ olcDbEnvFlags "
"$ olcDbNoSync $ olcDbIndex $ olcDbMaxReaders $ olcDbMaxSize "
"$ olcDbMode $ olcDbSearchStack $ olcDbMaxEntrySize $ olcDbRtxnSize "
- "$ olcDbMultival "
+ "$ olcDbMultival $ olcDbPageSize "
#ifdef MDB_ENCRYPT
"$ olcDbCryptoModule $ olcDbPassphrase "
#endif
goto fail;
}
+ if ( mdb->mi_pagesize ) {
+ rc = mdb_env_set_pagesize( mdb->mi_dbenv, mdb->mi_pagesize );
+ if ( rc ) {
+ Debug( LDAP_DEBUG_ANY,
+ LDAP_XSTRING(mdb_db_open) ": database \"%s\": "
+ "mdb_env_set_pagesize failed: %s (%d).\n",
+ be->be_suffix[0].bv_val, mdb_strerror(rc), rc );
+ goto fail;
+ }
+ }
+
#ifdef MDB_ENCRYPT
if ( mdb->mi_dbenv_encfuncs ) {
mdb_modsetup( mdb->mi_dbenv, mdb->mi_dbenv_encfuncs, mdb->mi_dbenv_enckey );