[LDB] Store index DNs as canonical case

simo simo at samba.org
Mon Aug 31 10:59:12 MDT 2009


On Mon, 2009-08-31 at 23:27 +1000, Andrew Bartlett wrote:
> The attached patch reworks our index code to always store the canonical
> casefolded form of the DN in an index.  It does not work yet, and needs
> to add a 'index version' to the ldb to trigger a reindex.  The
> casefolded index entries should be backward compatible, because the
> previous code accepted any case variation, so we are simply being more
> strict in what we now write.  
> 
> This was inspired by a bug where we would not delete index entries
> because the DN was not in a canonical from, and the existing
> strcasecmp() didn't match.  
> 
> (strcasecmp isn't the right option any more anyway)
> 
> This stems from the fact that LDB DNs were just case-insensitive strings
> originally, but have become far more complex since then. 
> 
> Any comments would be most welcome while I chase down the remaining
> issues. 

Comment:
this means that the index string format depends on the case sensitivity
of an attribute, this is a change in behavior, although I see you
recognize the need of a re-index the db on upgrade.

Question:
Have you done any test performance-wise ?

Aside: I have seen some odd behavior with indexes I think we need to be
a bit smarter with some search filters and reorder internal searches so
that we parse first indexes with the smallest number of entries, esp
when you have and 'and' expression of the form (&(foo=x)(bar=y)).
Have you looked into any of this by chance ?

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer <simo at samba.org>
Principal Software Engineer at Red Hat, Inc. <simo at redhat.com>



More information about the samba-technical mailing list