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

Re: subinitial and subfinal indexes not working?



There is a default constant minimal length for the subinitial and subfinal indexes. I think it is set to either 2 or 3 by default and searches for prefixes less then that (such as words differing by one character or none at all) will be basically linear searches through entire database. This minimal length can be changed (can't remember what the constant is but it's in one of the files where the indexes are computed, you can find it if you are persistant enough:))) - set it to 1 and you will get pre/post indexes as short as a single char. This will potentially make insertion operations slower, your database bigger (and potentially binarily incompatible with previous database though i am not sure how they store the keys) - to be on the safe side rebuild database from LDIF. Searches for prefixes that do not exist still may take forever..who knows... --Ugen -----Original Message----- From: owner-openldap-devel@OpenLDAP.org [mailto:owner-openldap-devel@OpenLDAP.org]On Behalf Of Andreas I'm running an instance of openldap-2.0.27 and it seems that the subinitial and subfinal indexes are not working. All for searches correctly return the same 4 entries, but with varying degrees of speed (the database contains about 170k entries): # time ldapsearch cn="jose roberto silva" > /dev/null real 0m0.108s user 0m0.010s sys 0m0.000s # time ldapsearch cn="*jose roberto silva*" > /dev/null real 0m0.123s user 0m0.010s sys 0m0.010s cn is indexed as follows: index cn eq,subinitial,subany,subfinal I had "sub" earlier, same result. Now, the following two searches take minutes to complete: # time ldapsearch cn="*jose roberto silva" > /dev/null real 1m49.929s user 0m0.010s sys 0m0.010s # time ldapsearch cn="jose roberto silva*" > /dev/null real 1m49.940s user 0m0.020s sys 0m0.010s Seems there is a problem with the subinitial and subfinal indexes, any hints? I *think* this also happens with openldap-2.1.21, but I'll try again later just to be sure.