summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-24 12:38:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:30:00 -0500
commit79cac4b6e2f1b4e808930cb584c20c11b5df903f (patch)
tree9eb59a5262f0dff4be37452c34e20903a4cbceea /source4
parent126c67313631df8df73d51cc99ede147fb77cbdb (diff)
downloadsamba-79cac4b6e2f1b4e808930cb584c20c11b5df903f.tar.gz
samba-79cac4b6e2f1b4e808930cb584c20c11b5df903f.tar.bz2
samba-79cac4b6e2f1b4e808930cb584c20c11b5df903f.zip
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 7b37923b726752101062fa8a92d3f96e41d55602)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_search.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c
index 3ecb2d9b39..8e84cfa681 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_search.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_search.c
@@ -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;
}