From: Howard Chu Date: Sat, 15 Dec 2001 23:21:37 +0000 (+0000) Subject: Use DB_HASH instead of DB_BTREE for index databases. Since index keys are X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~644 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bf61a1ca9d10afd4ae0fb9779b45ec81a9f839cc;p=openldap Use DB_HASH instead of DB_BTREE for index databases. Since index keys are mainly 4-byte hashes already, there is no locality-of-reference to exploit as a Btree. About a 7% performance gain. --- diff --git a/servers/slapd/back-bdb/dbcache.c b/servers/slapd/back-bdb/dbcache.c index 9fefd7f287..5e2d6dd41b 100644 --- a/servers/slapd/back-bdb/dbcache.c +++ b/servers/slapd/back-bdb/dbcache.c @@ -71,7 +71,6 @@ bdb_db_cache( rc = db->bdi_db->set_pagesize( db->bdi_db, BDB_PAGESIZE ); #ifdef BDB_IDL_MULTI rc = db->bdi_db->set_flags( db->bdi_db, DB_DUP | DB_DUPSORT ); - rc = db->bdi_db->set_dup_compare( db->bdi_db, bdb_bt_compare ); #endif file = ch_malloc( strlen( name ) + sizeof(BDB_SUFFIX) ); @@ -79,7 +78,7 @@ bdb_db_cache( rc = db->bdi_db->open( db->bdi_db, file, name, - DB_BTREE, bdb->bi_db_opflags | DB_CREATE | DB_THREAD, + DB_HASH, bdb->bi_db_opflags | DB_CREATE | DB_THREAD, bdb->bi_dbenv_mode ); ch_free( file );