From: Howard Chu Date: Thu, 27 Oct 2005 13:57:48 +0000 (+0000) Subject: Use #ifdef BDB_TOOL_IDL_CACHE to enable IDL cache. Leave disabled for X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~187 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=675cda1b622ed2cceea7bda54187e04e15eb8f6f;p=openldap Use #ifdef BDB_TOOL_IDL_CACHE to enable IDL cache. Leave disabled for now, it appears to just slow things down. --- diff --git a/servers/slapd/back-bdb/key.c b/servers/slapd/back-bdb/key.c index 87679612a8..7b36624e08 100644 --- a/servers/slapd/back-bdb/key.c +++ b/servers/slapd/back-bdb/key.c @@ -85,9 +85,11 @@ bdb_key_change( if (op == SLAP_INDEX_ADD_OP) { /* Add values */ +#ifdef BDB_TOOL_IDL_CACHING if ( slapMode & SLAP_TOOL_QUICK ) rc = bdb_tool_idl_add( be, db, txn, &key, id ); else +#endif rc = bdb_idl_insert_key( be, db, txn, &key, id ); if ( rc == DB_KEYEXIST ) rc = 0; } else { diff --git a/servers/slapd/back-bdb/tools.c b/servers/slapd/back-bdb/tools.c index 6a4bd3a31c..d3701e1593 100644 --- a/servers/slapd/back-bdb/tools.c +++ b/servers/slapd/back-bdb/tools.c @@ -38,13 +38,12 @@ static unsigned nholes; static int index_nattrs; +#ifdef BDB_TOOL_IDL_CACHING #define bdb_tool_idl_cmp BDB_SYMBOL(tool_idl_cmp) #define bdb_tool_idl_flush_one BDB_SYMBOL(tool_idl_flush_one) #define bdb_tool_idl_flush BDB_SYMBOL(tool_idl_flush) static int bdb_tool_idl_flush( BackendDB *be ); -static int bdb_tool_ix_rec( int base ); -static void * bdb_tool_index_task( void *ctx, void *ptr ); #define IDBLOCK 1024 @@ -61,6 +60,7 @@ typedef struct bdb_tool_idl_cache { } bdb_tool_idl_cache; static bdb_tool_idl_cache_entry *bdb_tool_idl_free_list; +#endif /* BDB_TOOL_IDL_CACHING */ static ID bdb_tool_ix_id; static Operation *bdb_tool_ix_op; @@ -70,6 +70,9 @@ static struct bdb_info *bdb_tool_info; static ldap_pvt_thread_mutex_t bdb_tool_index_mutex; static ldap_pvt_thread_cond_t bdb_tool_index_cond; +static int bdb_tool_ix_rec( int base ); +static void * bdb_tool_index_task( void *ctx, void *ptr ); + int bdb_tool_entry_open( BackendDB *be, int mode ) { @@ -138,7 +141,9 @@ int bdb_tool_entry_close( cursor = NULL; } +#ifdef BDB_TOOL_IDL_CACHING bdb_tool_idl_flush( be ); +#endif if( nholes ) { unsigned i; @@ -735,7 +740,7 @@ done: return e->e_id; } - +#ifdef BDB_TOOL_IDL_CACHING static int bdb_tool_idl_cmp( const void *v1, const void *v2 ) { @@ -1020,6 +1025,7 @@ int bdb_tool_idl_add( return 0; } +#endif static void * bdb_tool_index_task( void *ctx, void *ptr )