If you have query like (|(objectclass=*)(objectclass=ldapsubentry)),
may a scope=0, as for I know the filters get evaluated independently
objectclass=* then objectclass=ldapsubentry , then an intersection of
two sets is computed . The resulting entry ids would be checked
against the ancestorid index for the subtree , scope to arrive at the
final results . Is this a correct understanding ?
Nope. For a base scope search the base entry is found alone (using the cache
and if it isn't in there the entrydn index). Then the filter is applied
to the entry.
Is there any other way the scope is handled ?
You really need to read the code to understand how queries are processed.
Look at ldbm_search.c and filterindex.c.