dns: changing onelevel search for wildcard to subtree
authorAaron Haslett <aaronhaslett@catalyst.net.nz>
Wed, 9 Jan 2019 03:22:40 +0000 (16:22 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Fri, 11 Jan 2019 01:55:01 +0000 (02:55 +0100)
SCOPE_ONELEVEL is used on wildcard dns searches, but onelevel searches
currently have a performance problem related to GUID indexing, so this
patch changes the search scope to SCOPE_SUBTREE.
In this case, as the onelevel and subtree sets of records are roughly
the same, and the query is matching against the DN itself, we don't
believe there's any benefit in using SCOPE_ONELEVEL over SCOPE_SUBTREE.

The onelevel performance problem will be fixed separately later, but in
the meantime this solves the DNS performance problem.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13738

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source4/dns_server/dnsserver_common.c

index 656d7ca6bff6a1fe82e3d7d85b16a6a1388c3d46..e0849713604f2d390e4ab1c2ff70f79a2613ef2b 100644 (file)
@@ -482,7 +482,7 @@ static int dns_wildcard_lookup(struct ldb_context *samdb,
                                      samdb,
                                      frame,
                                      parent,
-                                     LDB_SCOPE_ONELEVEL,
+                                     LDB_SCOPE_SUBTREE,
                                      query,
                                      attrs,
                                      NULL,