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

Not searching via index



Hi,

Solaris 8
OpenLDAP 2.0.18
BerkeleyDB 3.3.11

I've got a directory of ~120000 eduPerson entries.  The dn of each entry
is uid plus the base.  uid is an attribute in each entry as well.  uid
is indexed:

index uid pres,eq

My problem is that when I do

ldapsearch  -x -b 'dc=unsw,dc=edu,dc=au' '(uid=something)'

The response takes a really long time because the server is reading thru
each entry to see if it matches, whereas what I'd like to see is it
consult the index alone to find the answer.

The appropriate part of the log at level -1 is


conn=0 op=1 SRCH base="dc=unsw,dc=edu,dc=au" scope=2
filter="(uid=s8803964)"
=> ldbm_back_search
dn2entry_r: dn: "DC=UNSW,DC=EDU,DC=AU"
=> dn2id( "DC=UNSW,DC=EDU,DC=AU" )
=> ldbm_cache_open( "dn2id.dbb", 73, 600 )
ldbm_cache_open (blksize 8192) (maxids 2046) (maxindirect 5)
<= ldbm_cache_open (opened 0)
<= dn2id 1
=> id2entry_r( 1 )
=> ldbm_cache_open( "id2entry.dbb", 73, 600 )
ldbm_cache_open (blksize 8192) (maxids 2046) (maxindirect 5)
<= ldbm_cache_open (opened 1)
=> str2entry
<= str2entry(dc=unsw, dc=edu, dc=au) -> -1 (0x9f9e8)
entry_rdwr_rlock: ID: 1
<= id2entry_r( 1 ) 0x9f9e8 (disk)
search_candidates: base="DC=UNSW,DC=EDU,DC=AU" s=2 d=0
=> filter_candidates
        AND
=> list_candidates 0xa0
=> filter_candidates
        DN SUBTREE
=> dn2idl( "@DC=UNSW,DC=EDU,DC=AU" )
=> ldbm_cache_open( "dn2id.dbb", 73, 600 )
<= ldbm_cache_open (cache 0)
=> ldbm_cache_open( "nextid.dbb", 73, 600 )
ldbm_cache_open (blksize 8192) (maxids 2046) (maxindirect 5)
<= ldbm_cache_open (opened 2)
<= filter_candidates 123547
=> filter_candidates
        OR
=> list_candidates 0xa1
=> filter_candidates
        EQUALITY
=> equality_candidates
<= equality_candidates: index_param returned=18
<= filter_candidates 123547
=> filter_candidates
        EQUALITY
=> equality_candidates
=> ldbm_cache_open( "uid.dbb", 73, 600 )
ldbm_cache_open (blksize 8192) (maxids 2046) (maxindirect 5)
<= ldbm_cache_open (opened 3)
=> key_read
<= index_read 1 candidates
<= equality_candidates 1
<= filter_candidates 1
<= list_candidates 123547
<= filter_candidates 123547
<= list_candidates 123547
<= filter_candidates 123547
entry_rdwr_runlock: ID: 1
====> cache_return_entry_r( 1 ): created (0)
=> id2entry_r( 1 )
entry_rdwr_rtrylock: ID: 1
====> cache_find_entry_id( 1 ) "dc=unsw, dc=edu, dc=au" (found) (1
tries)
<= id2entry_r( 1 ) 0x9f9e8 (cache)
=> test_filter
    EQUALITY
=> access_allowed: search access to "dc=unsw, dc=edu, dc=au" "uid"
requested
=> dnpat: [1] .*,dc=unsw,dc=edu,dc=au nsub: 0
=> dnpat: [2] .*,dc=unsw,dc=edu,dc=au nsub: 0
=> acl_get: [3] check attr uid
<= acl_get: [3] acl dc=unsw, dc=edu, dc=au attr: uid
=> acl_mask: access to entry "dc=unsw, dc=edu, dc=au", attr "uid"
requested
=> acl_mask: to value by "", (=n)
<= check a_dn_pat: self
<= check a_dn_pat: cn=Manager, dc=unsw, dc=edu, dc=au
=> string_expand: pattern:  cn=Manager, dc=unsw, dc=edu, dc=au
=> string_expand: expanded: cn=Manager, dc=unsw, dc=edu, dc=au
=> regex_matches: string:
=> regex_matches: rc: 1 no matches
<= check a_dn_pat: *
<= acl_mask: [3] applying none (=n) (stop)
<= acl_mask: [3] mask: none (=n)
=> access_allowed: search access denied by none (=n)
<= test_filter 50
ldbm_search: candidate 1 does not match filter
entry_rdwr_runlock: ID: 1
====> cache_return_entry_r( 1 ): returned (0)
daemon: select: listen=7 active_threads=1 tvp=NULL
=> id2entry_r( 2 )
=> ldbm_cache_open( "id2entry.dbb", 73, 600 )
<= ldbm_cache_open (cache 1)
=> str2entry
<= str2entry(cn=Manager, dc=unsw, dc=edu, dc=au) -> -1 (0x9fa88)
entry_rdwr_rlock: ID: 2
<= id2entry_r( 2 ) 0x9fa88 (disk)
=> test_filter
    EQUALITY
=> access_allowed: search access to "cn=Manager, dc=unsw, dc=edu, dc=au"
"uid" r
equested
=> dnpat: [1] .*,dc=unsw,dc=edu,dc=au nsub: 0
=> acl_get: [1] matched
=> acl_get: [1] check attr uid
=> dnpat: [2] .*,dc=unsw,dc=edu,dc=au nsub: 0
=> acl_get: [2] matched
=> acl_get: [2] check attr uid
<= acl_get: [2] acl cn=Manager, dc=unsw, dc=edu, dc=au attr: uid
=> acl_mask: access to entry "cn=Manager, dc=unsw, dc=edu, dc=au", attr
"uid" re
quested
=> acl_mask: to value by "", (=n)
<= check a_dn_pat: self
<= check a_dn_pat: cn=Manager, dc=unsw, dc=edu, dc=au
=> string_expand: pattern:  cn=Manager, dc=unsw, dc=edu, dc=au
=> string_expand: expanded: cn=Manager, dc=unsw, dc=edu, dc=au
=> regex_matches: string:
=> regex_matches: rc: 1 no matches
<= check a_dn_pat: *
<= acl_mask: [3] applying read (=rscx) (stop)
<= acl_mask: [3] mask: read (=rscx)
=> access_allowed: search access granted by read (=rscx)
<= test_filter 5
ldbm_search: candidate 2 does not match filter




it then goes on to look at each of the other 123000 entries.  Can
anybody tell me what's going on here?


TIA,

Geoff Hort
University of NSW