1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

r8736: this fixes the ldb speed (raises BENCH-WINS from 15 ops/sec to over 4000)

simo, we need to be careful to cope with this sort of direct dn query efficiently
(This used to be commit 7b37923b72)
This commit is contained in:
Andrew Tridgell 2005-07-24 12:38:42 +00:00 committed by Gerald (Jerry) Carter
parent 126c673136
commit 79cac4b6e2

View File

@ -461,6 +461,13 @@ int ltdb_search_bytree(struct ldb_module *module, const char *base,
struct ltdb_private *ltdb = module->private_data;
int ret;
/* it is important that we handle dn queries this way, and not
via a full db search, otherwise ldb is horribly slow */
if (tree->operation == LDB_OP_EQUALITY &&
ldb_attr_cmp(tree->u.equality.attr, "dn") == 0) {
return ltdb_search_dn(module, tree->u.equality.value.data, attrs, res);
}
if (ltdb_lock_read(module) != 0) {
return -1;
}