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

Re: How indexes used with search

Emmanuel LÃcharny wrote:
Le 9/26/12 2:01 PM, Howard Chu a Ãcrit :
Roman Rybalko wrote:
25.09.2012 14:57, Roman Rybalko ÐÐÑÐÑ:
Also it's not clear for me how objectID set is determined when there
is search on "one" scope? The same when "sub" scope cover not the full
database contents but a part of the object tree (suffix: cn=test,
search base: cn=test1,cn=test)? I thought that search with base
covering not the full backend suffix (but a partial tree) should work
faster, but seems this is not true, even overhead introduced by
additional objectID set. Right?
Howard, can you explain it please?

The scope is just another set, yes. It must be ANDed with the index
sets. Searches with subtree scope over the entire database use a
shortcut, instead of reading a scope set we just use a fake set
representing all IDs. Searches over any other scope cannot take any

As discussed with Howard last month, OneLevel scope can define a set of
candidate IDs too, as soon as you can extract the children of the base
entry from the Rdn index. Not sure OpenLDAP support that atm. Howard ?

The actual answer depends on which backend you're using. There's little point in discussing it when you can just read the source code to get the details. back-bdb uses explicit scope indices. back-hdb and back-mdb use only an rdn index.

  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/