From: Andrew Bartlett Date: Thu, 17 Aug 2017 00:44:34 +0000 (+1200) Subject: ldb_tdb: Do not add an index for GUID_index_attribute X-Git-Url: http://git.samba.org/?p=metze%2Fsamba%2Fwip.git;a=commitdiff_plain;h=ba762fac819eaefd980bd795de5227a04d2fbb2e ldb_tdb: Do not add an index for GUID_index_attribute This would be pointless and we no longer query for it. Signed-off-by: Andrew Bartlett Reviewed-by: Garming Sam --- diff --git a/lib/ldb/ldb_tdb/ldb_index.c b/lib/ldb/ldb_tdb/ldb_index.c index fc5d9678e4d8..73667e53b946 100644 --- a/lib/ldb/ldb_tdb/ldb_index.c +++ b/lib/ldb/ldb_tdb/ldb_index.c @@ -629,6 +629,12 @@ static bool ltdb_is_indexed(struct ldb_module *module, unsigned int i; struct ldb_message_element *el; + if ((ltdb->cache->GUID_index_attribute != NULL) && + (ldb_attr_cmp(attr, + ltdb->cache->GUID_index_attribute) == 0)) { + /* Implicity covered, this is the index key */ + return false; + } if (ldb->schema.index_handler_override) { const struct ldb_schema_attribute *a = ldb_schema_attribute_by_name(ldb, attr);