summaryrefslogtreecommitdiff
path: root/source4/dsdb/schema/schema_init.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2017-03-30 13:25:35 +1300
committerAndrew Bartlett <abartlet@samba.org>2017-05-31 06:34:27 +0200
commite7c36a7142198c9a8efb769627af4488e0bb5dc0 (patch)
tree8848d0e3b0e4d0514cc3535b0f76d0bd3d67c1ef /source4/dsdb/schema/schema_init.c
parent13e09c72cd41cd5cd44bd9e4e27df8e0e1d47379 (diff)
downloadsamba-e7c36a7142198c9a8efb769627af4488e0bb5dc0.tar.gz
schema: Use ldb_schema_set_override_indexlist for faster index selection
This allows Samba to provide a binary tree lookup for the existance of an index on the attribute rather than the O(n) lookup that was being done for each attribute during a search or modify Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'source4/dsdb/schema/schema_init.c')
-rw-r--r--source4/dsdb/schema/schema_init.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c
index 256c4677452..c76b57cb4a9 100644
--- a/source4/dsdb/schema/schema_init.c
+++ b/source4/dsdb/schema/schema_init.c
@@ -514,6 +514,10 @@ static int dsdb_schema_setup_ldb_schema_attribute(struct ldb_context *ldb,
a->flags |= LDB_ATTR_FLAG_SINGLE_VALUE;
}
+ if (attr->searchFlags & SEARCH_FLAG_ATTINDEX) {
+ a->flags |= LDB_ATTR_FLAG_INDEXED;
+ }
+
return LDB_SUCCESS;
}