I have done a search for an unindexed attribut, another search for an unindexed attribute starting with a "*" and a search for an indexed attribute starting with a "*". All three took abount 5 secs on my hardware.
So these test results seem to prove that the index is not used at all as you pointed out. Will this have a chance to be improved later? OpenLDAP has the ability to configure an index as substring index which improves also searches starting (not only ending) with a "*" drastically. Is this possible which ApacheDS too? I found a checkin which could be related. http://svn.apache.org/viewvc?view=revision&revision=1398737 Did this only speed up the search ending with the "*" cause these ones are fast. With regards Ernst Bech Von: Emmanuel Lécharny <[email protected]> An: [email protected], Datum: 21.03.2014 17:50 Betreff: Re: [ApacheDS] Slow search for a string starting with "*" Le 3/21/14 5:18 PM, Ernst Bech a écrit : > I'm using ApacheDS 2.0.0-M16. > > I made "cn" an index, imported my own schema and then imported a bunch of > data (4000 entries) based partially on the own schema. > > After importing was finished I did a number of searches. The searches for > "(cn=foo)" and "(cn=foo*)" were very fast (msecs) as expected but the > search for "(cn=*foo)" was very slow (seconds). > > Is this a known issue or can it be improved? > This is a known issue. Also it should not take seconds. The rational is that substring searches are done by doing a full scan (ie, each entry is being read, and the cn attribute will be compared to the filter). With 4000 entries in your base, it should take less than a second. -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com
