I'd like to understand how indexes are used with search.
I've found some info
http://www.openldap.org/doc/admin24/tuning.html#Understanding how a search works
but that's not very precise.

Suppose there is a search like (&(attr1=value1)(attr2=value2)), attr1 and attr2 are indexed.
As far as I understand, this search fetches objectIDs from the index on attr1, than the objectIDs from the index on attr2, than, according to operation "and" ("&"), objectIDs that present in BOTH sets are determined (using some set-intersection algorithm).
When the search is "or" (|(...)(...)), the objectIDs from both sets are joined and duplicates are removed (using some set-union algorithm).
If there is no index on attribute, the resulting objectID set is determined by bare iterate-and-compare on all the objects, or so.
Am I right?

Could anyone advice some docs on this?
-- 
WBR,
Roman Rybalko