]> git.sur5r.net Git - openldap/commitdiff
Use #ifdef BDB_TOOL_IDL_CACHE to enable IDL cache. Leave disabled for
authorHoward Chu <hyc@openldap.org>
Thu, 27 Oct 2005 13:57:48 +0000 (13:57 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 27 Oct 2005 13:57:48 +0000 (13:57 +0000)
now, it appears to just slow things down.

servers/slapd/back-bdb/key.c
servers/slapd/back-bdb/tools.c

index 87679612a8bf6a72724eb3cf5b491159a1ebe41b..7b36624e08a5a3c4c2c9ee7fb9a8e15b9ea1bc42 100644 (file)
@@ -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 {
index 6a4bd3a31c85371872001f039d7db22132915ea6..d3701e15931dfdeb774c5c0a8c35e389ada5a73d 100644 (file)
@@ -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 )