ldb_kv: Avoid memdup of database records in the case of base searches
commita76d2865372988c29baef42ecc4257e861692e7b
authorGarming Sam <garming@catalyst.net.nz>
Thu, 7 Mar 2019 03:45:46 +0000 (7 16:45 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 11 Apr 2019 04:17:11 +0000 (11 04:17 +0000)
tree9e7261a1f0cafa3a1794ab6ae3219af56d901bf7
parentd6b1d55659348e0347da702794de92b6f789b5cc
ldb_kv: Avoid memdup of database records in the case of base searches

This makes LDAP bind significantly faster in the case of having many
members, due to large size of these records (with tens of thousands of
member links). During the nested group calculation, you are only
interested in memberOf not the member links.

(We add a bit-field to determine whether or not the backend actually
supports pointing into database memory. For some reason TDB pointers
aren't stable, so for now we set this option just on LMDB backends.)

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/include/ldb_module.h
lib/ldb/ldb_key_value/ldb_kv.h
lib/ldb/ldb_key_value/ldb_kv_index.c
lib/ldb/ldb_key_value/ldb_kv_search.c
lib/ldb/ldb_mdb/ldb_mdb.c
lib/ldb/ldb_tdb/ldb_tdb.c