[Date Prev][Date Next]
Re: ITS#7473 back-mdb search
- To: OpenLDAP Devel <firstname.lastname@example.org>
- Subject: Re: ITS#7473 back-mdb search
- From: Emmanuel LÃcharny <email@example.com>
- Date: Fri, 11 Jan 2013 14:13:25 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:reply-to:user-agent:mime-version:to :subject:references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=8Um6RTunx2RjktpXQJKArL3CbneBZIPThNp88Jf5vS4=; b=ydu3JVy1av9kjhe84GvEh6+3UrfnY9XZeIy8uhA1jZ26xGR8iVeT+CGXYGy3HGvv+P E/uiGbzlKorh9Yy11GC8xxtGQKgjJR95ESlWmXWv2kS9M/bptYoRxr4mLuNR+LTB69uy 7aCyHDqQHlTVd1sPktvcBAB6sehnqa41NiIhXSeo4ZtM7Due5iz2msen7bV1ZXyx7Si0 c19SXHozx7Ozs4JVDvXwB/TQ28EQ747xDuLiIyKEX8pafDrnsYm/5y7B2fzZT8BzItEL tp6ZW1b7LgmUOZdIJJ3Cj831cXmf6zMfoyW/uvtmYWMnfaAneP4sUQrxpukBLolm4upL OZ0A==
- In-reply-to: <50F00ADC.firstname.lastname@example.org>
- References: <50F00ADC.email@example.com>
- User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130107 Thunderbird/17.0.2
Le 1/11/13 1:51 PM, Howard Chu a Ãcrit :
> /* There are two approaches to the search function:
> * 1) walk the list of filter candidates, and see which are in scope.
> * 2) walk the scope tree, and see which are in the filter
> * (1) is faster if the filter candidate list is smaller than the
> scope tree,
> * and vice versa. Currently only (1) is implemented.
> * We don't know the actual size of the subtree, we only know the
> count of
> * onelevel children. For subtree searches we take a guess.
> * Due to the fact pagedResults cookie is only big enough to store
> a single
> * entryID, if pagedResults is in use we will always do (1). For
> (2) to work
> * reliably we need to use the parent's entryID, to avoid losing
> our place
> * if the target entry is moved or deleted. We'd also need to
> store the
> * count of where we were under the parent. I.e., we need the
> cookie to be
> * two words long. We can examine that in the future, but the
> * cookie definition is global to all of slapd so the change would
> * other backends and overlays.
> We could alter the dn2id index format, and maintain a numSubordinates
> counter there. That would avoid the need to guess. Otherwise I figure
> we fudge a guess based on the number of onelevel children and the
> depth of the baseDN (relative to the suffix). I.e., the longer the DN,
> the smaller the guess, relative to the total number of entries in the
> DB. Naturally I'd prefer to avoid altering the dn2id index format.
ApacheDS stores the number of children, and the bumber of descendants
alltogether, in the dn2id table. That allows use to use the scope as the
primary filter for candidates. The extra cost is when you
add/delete/move an entry, you have to update all the dn2id (in OpenLDAP
terminology) parents from the modified entry down to the root. That's a
price we accept to pay.
Once you have this number, you can use either (1) or (2) to start with.
At least, you are sure to pick the smallest set of candidates.
Before that, we had a OneLevel index and a SubLevel index which were
containing the number of children/descendant for each entry. This is a
way to avoid modifying the dn2id table, but that's two index you have to
update everytime you do an add/del/mod. We get rid of those two tables
recently, gaining some time and disl space in the process.