[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: indexing objectclass: why?



I noticed this in the back-bdb code, didn't realize it was also in
back-ldbm. In back-bdb I've optimized this a bit by scanning the user filter
in advance, looking for any instances of objectClass in the filter (besides
objectClass present). If none are found, the alias and referral filters are
omitted. I think this change should probably go into back-ldbm as well.

On a side note, I actually created a presence index for objectClass, which
turned out to be a silly thing to do. Creating such huge ID lists makes the
objectClass index database very inefficient. The backend probably ought to
silently ignore if this appears in a .conf file, and just implicitly return
a match on the entire database for this filter.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support

> -----Original Message-----
> From: owner-openldap-software@OpenLDAP.org
> [mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of Julio Sánchez
> Fernández
> Sent: Thursday, November 29, 2001 10:09 AM
> To: Roel van Meer
> Cc: openldap-software@OpenLDAP.org; Terry Davis
> Subject: Re: indexing objectclass: why?
>
>
> Roel van Meer <rolek@linvision.com> writes:
>
> > This helped. search times went down from 47 seconds to about 0.02
> > seconds.
> > Can anyone explain to me _why_ this influences performance so much?
>
> There are special entries in the directory that may match your filter
> and, even logically part of your search universe, might not be
> contained physically in the backend database or searched subtree.
>
> These entries are referrals and aliases.
>
> Unless specific circumstances arise, slapd needs to retrieve those
> entries from the database to dereference or chase them to see if they
> match your search criteria.
>
> It does this by artificially enhancing your search filter with
> objectclass searches.  Look in servers/slapd/back-ldbm/search.c,
> function search_candidates.
>
> Well, it might be overkill in some cases, but that's the way it is
> implemented now.
>
> So if you don't have an objectclass index, many of your searches will
> suffer.
>
> Julio
>