[PATCH] make ldb-tdb multivalued attributes more efficient

Douglas Bagnall douglas.bagnall at catalyst.net.nz
Wed Jun 14 04:01:36 UTC 2017


hi,

These patches improve the efficiency with which we check the
uniqueness constraints on multivalued attributes. Until now we have
always used an O(n^2) algorithm; with this we switch to O(n log n)
when there are more than 10 attributes.

It turned out this made the most noticeable difference with linked
attributes where the uniqueness checking is supposed to be handled by
the repl_meta_data module. This led to a few changes there to help it
to communicate its findings, thence to tests and miscellaneous changes
to error codes.

The first few patches are fixing whitespace and typos, which makes for
tedious reading. Sorry.

The patches are sort of looking towards a solution to
https://bugzilla.samba.org/show_bug.cgi?id=7485 -- that is, to use
schema-aware comparison functions rather than dumb case-sensitive
memcmp. The effect of that is the ldb context and a flags variable are
handed around where they aren't yet needed, with a view to avoiding an
ABI change.

Andrew Bartlett has already reviewed these, so don't feel the need to
review fully unless you are leaning toward a NACK.

cheers,
Douglas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ldb-tdb-multivalue-attributes.patch
Type: text/x-patch
Size: 111533 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170614/35510c5f/ldb-tdb-multivalue-attributes-0001.bin>


More information about the samba-technical mailing list