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

Search using indexed attributtes

Hi everybody,

we have some performance problems in searches based on indexed attributes.

First of all I will explain our OpenLDAP configuration:

1. We have the next line in slapd.conf
	index my_id,my_login        eq

2. We have defined attributes as follows in local.schema

	attributetype ( NAME 'my_id'
	        DESC 'Bla Bla Bla'
	        EQUALITY caseExactMatch
	        SINGLE-VALUE )

	attributetype ( NAME 'my_login'
	        DESC 'Bla Bla Bla'
	        EQUALITY caseExactMatch
	        SINGLE-VALUE )

	objectclass ( NAME 'my_user'
	        DESC 'Bla Bla Bla'
	        MUST ( my_id $ my_login )
	        MAY ( my_password $ my_appList ) )

3. and when we create users we use the following ldiff syntax

	dn: my_login=test5,o=testcorp,c=es,ou=users
	objectClass: my_user
	my_id: 5
	my_login: test5
	my_password: testpasswd
	my_appList: App1, App2

4. our LDAP database has over 2.000.000 users

The problem rise up when we SEARCH using the my_id attribute, because it
takes too much time (in order of several minutes).

if we search using the DN (my_login=xxxxx,o=testcorp,c=es,ou=users) it works
fine (in order of milliseconds), but if we try to search using the baseDN
(o=testcorp,c=es,ou=users) and a filter (my_id=xxxx) it takes too long to
complete the search (it seems it goes throught all entries searching for
that attribute).

Search command using the filter (the one that takes too long)
	./ldapsearch -h ldap1 -b "o=testcorp,c=es,ou=users" "my_id=500000"

Search command using the exact DN (the one that works fine)
	./ldapsearch -h ldap1 -b

Does anyone know if our configuration is wrong or if we have to use the
search command in another way?

Thanks for your help !!!


  Wanadoo España

  Sistemas y Servicios / Servicios de Valor Añadido
  Vicente Martínez Martínez / vmartinez@es.wanadoo.com