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

slapd presence search problem



Hello,

I apologize in advance for the length of this post, but I've tried to
include all pertinent information to avoid
multiple requests for additional data.

There was mention of the same/similar problem in the archives, posted by
Trevor Porter.  I corresponded with Trevor and he told me that he hadn't
solved this problem, so we'll try again ;-)

The problem:

We have an LDAP database with approx 9000 entries.  A small number (23) of
these entries have values for the user defined attribute 'dtar'.  This
attribute has been indexed using the type "pres".  When we search the
database for occurrences of this attribute,  it seems that the "dtar" index
is ignored for some reason and the entire database is searched using the
'objectclass' (allids ?) index.  If we index 'dtar' using "pres" and "sub"
and search for "dtar=a*", it seems to use the "dtar" index, however this is
not a viable "work around" since the values of this attribute are arbitrary
strings.

Lastly, this user defined attribute is 'ces' since it's contents are fully
qualified file system pathnames.

I would greatly appreciate someone pointing me towards a solution to this
problem - the search of the entire database is NOT acceptable to our users.

Thanks in advance for any assistance.

Please see what is hopefully relevant data below...



*************************************
The environment:

HP-UX 11.0
gcc 2.8.1
OpenLDAP version 1.27
gdbm 1.8.0

*************************************
Excerpt from the slapd.conf file:

#############################
# ldbm indexed attributes definitions    #
#############################

index   uid     pres,eq
index   cn,sn   pres,eq,approx,sub
index   dtar    pres
index   default  none

*************************************
The list of 'dtar' attribute occurrences:

pen7:/usr/local/ldbm-vadoe # ldbmtest -f cf
dbtest: ti
  attr: dtar
key: * (len 2)
data:
        nmax=32
        ncur=23
        327
        438
        808
        1193
        1455
        1808
        2011
        2601
        3018
        3095
        3536
        4262
        4393
        5095
        5504
        5554
        5564
        5837
        6307
        7009
        7674
        8475
        8750
dbtest:

*************************************

The search command:


ldapsearch -L -S "" -b "$BDN" -h localhost -D "$RTDN" -w "$RTPW" "dtar=*"
"dtar"


*************************************

Excerpt from the slapd log file:


ber_dump: buf 0x4005b978, ptr 0x4005b978, end 0x4005b9c3
          current len 75, contents:
  02 01 02  c  F 04  '  o  =  V  i  r  g  i  n  i
   a 20  D  e  p  a  r  t  m  e  n  t 20  o  f 20
   E  d  u  c  a  t  i  o  n  ,  c  =  U  S 0a 01
  02 0a 01 00 02 01 00 02 01 00 01 01 00 87 04  d
   t  a  r  0 06 04 04  d  t  a  r
do_search
SRCH "O=VIRGINIA DEPARTMENT OF EDUCATION,C=US" 2 0    0 0 0
begin get_filter
PRESENT
end get_filter 0
    filter: (dtar=*)
    attrs: dtar
conn=0 op=1 SRCH base="O=VIRGINIA DEPARTMENT OF EDUCATION,C=US" scope=2
filter="
(dtar=*)"
=> ldbm_back_search
using base "O=VIRGINIA DEPARTMENT OF EDUCATION,C=US"
subtree_candidates: base: "O=VIRGINIA DEPARTMENT OF EDUCATION,C=US" lookupbase
dn2entry_r: dn: "O=VIRGINIA DEPARTMENT OF EDUCATION,C=US"
=> dn2id( "O=VIRGINIA DEPARTMENT OF EDUCATION,C=US" )
====> cache_find_entry_dn2id: found dn: O=VIRGINIA DEPARTMENT OF EDUCATION,C=US
<= dn2id 8307 (in cache)
=> id2entry_r( 8307 )
====> cache_find_entry_dn2id: found id: 8307 rw: 0
entry_rdwr_rtrylock: ID: 8307
<= id2entry_r 0x4005bad0 (cache)
====> cache_return_entry_r
entry_rdwr_runlock: ID: 8307
=> filter_candidates
  OR
=> list_candidates 0xa1
=> filter_candidates
  EQUALITY
=> ava_candidates 0xa3
=> index_read( "objectclass" "=" "REFERRAL" )
=> ldbm_cache_open( "/usr/local/ldbm-vadoe/objectclass.gdbm", 2, 600 )
ldbm_cache_open (blksize 8192) (maxids 2046) (maxindirect 2)
<= ldbm_cache_open (opened 2)
<= index_read 0 candidates
listening for connections on 3, activity on: 5r
before select active_threads 2
<= ava_candidates 0
<= filter_candidates 0
=> filter_candidates
  PRESENT
=> presence_candidates
=> index_read( "dtar" "?" "*" )
<= index_read 8947 candidates (allids - not indexed)
<= presence_candidates 8947
<= filter_candidates 8947
<= list_candidates 8947
<= filter_candidates 8947
=> id2entry_r( 1 )
=> ldbm_cache_open( "/usr/local/ldbm-vadoe/id2entry.gdbm", 2, 600 )
<= ldbm_cache_open (cache 1)





--
Joe Guderjohn
guderjoj@erols.com