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

Possible optimization



Hi,

some of you may have seen my previous posting regarding failing substring
searches. In researching this, I came across the following output:

SUBSTRINGS
begin get_substring_filter
  INITIAL
end get_substring_filter
end get_filter 0
    filter: (maildrop=DS9A@CASEMA.NET,*)
    attrs:
=> ldbm_back_search
using base "DC=CASEMA,DC=NET"
subtree_candidates: base: "DC=CASEMA,DC=NET" lookupbase
dn2entry_r: dn: "DC=CASEMA,DC=NET"
=> dn2id( "DC=CASEMA,DC=NET" )
====> cache_find_entry_dn2id: found dn: DC=CASEMA,DC=NET
<= dn2id 1 (in cache)
=> id2entry_r( 1 )
====> cache_find_entry_dn2id: found id: 1 rw: 0
entry_rdwr_rtrylock: ID: 1
<= id2entry_r 0x8096410 (cache)
====> cache_return_entry_r
entry_rdwr_runlock: ID: 1
=> filter_candidates
        OR
=> list_candidates 0xa1
=> filter_candidates
        EQUALITY
=> ava_candidates 0xa3
=> index_read( "objectclass" "=" "REFERRAL" )
=> ldbm_cache_open( "/var/ldap/objectclass.dbb", 7, 600 )
ldbm_cache_open (blksize 4096) (maxids 1022) (maxindirect 4)
<= ldbm_cache_open (opened 2)
<= index_read 0 candidates
<= ava_candidates 0
<= filter_candidates 0
=> filter_candidates
        SUBSTRINGS
=> substring_candidates
=> substring_comp_candidates
=> index_read( "maildrop" "*" "^DS" )
=> ldbm_cache_open( "/var/ldap/maildrop.dbb", 7, 600 )
ldbm_cache_open (blksize 4096) (maxids 1022) (maxindirect 4)
<= ldbm_cache_open (opened 3)
<= index_read 44 candidates
=> index_read( "maildrop" "*" "DS9" )
=> ldbm_cache_open( "/var/ldap/maildrop.dbb", 7, 600 )
<= ldbm_cache_open (cache 3)
<= index_read 1 candidates
(etc etc etc)

Now, it appears to me that once you have found *1* candidate, it must be it,
and further index_read()ing can stop. 

Just a thought.

Regards,

bert hubert.

-- 
    +---------------+  |              http://www.rent-a-nerd.nl
    | nerd for hire |  |                  
    +---------------+  |                     - U N I X -
            |          |          Inspice et cautus eris - D11T'95