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

RE: multiple attribute search with single return slowness



On Mon, 26 Apr 2004, Armbrust, Daniel C. wrote:

> >Queries are of the form 
> >"(&(objectClass=qmailUser)(|(mail=$i)(mailAlternateAddress=$i)))"
> 
> I haven't followed this whole thread (so maybe this has already been 
> covered) but I have found that I can speed up my queries by a factor of 
> 3 simply by not specifying an objectClass in the query.  (Instead, I 
> ask for the object class to be returned as an attribute, and iterate 
> over them) but this may not apply, depending on your data structure... 
> On the queries where I discovered this, specifying object class was at 
> most filtering out 3 to 4 entries (and I was only looking for one 
> specific entry).  And our data structure is pretty different from the 
> normal directory use case.


In my case:
1)taking out the objectclass in the filter has minimal performance impact 
(~0.5%):
$  for j in 10 100 1000;do echo -e "\n$j searches:";time for i in `cat 
/tmp/mail-mailalternateaddress.txt|head -n $j`;do ldapsearch -x 
"(&(objectClass=qmailUser)(|(mail=$i)(mailAlternateAddress=$i)))" -LLL dn 
>>/dev/null;done;done

10 searches:

real    0m0.239s
user    0m0.150s
sys     0m0.090s

100 searches:

real    0m2.257s
user    0m1.460s
sys     0m0.670s

1000 searches:

real    0m22.656s
user    0m15.100s
sys     0m6.590s

$  for j in 10 100 1000;do echo -e "\n$j searches:";time for i in `cat 
/tmp/mail-mailalternateaddress.txt|head -n $j`;do ldapsearch -x 
"(|(mail=$i)(mailAlternateAddress=$i))" -LLL dn >>/dev/null;done;done

10 searches:

real    0m0.237s
user    0m0.160s
sys     0m0.080s

100 searches:

real    0m2.254s
user    0m1.430s
sys     0m0.730s

1000 searches:

real    0m22.256s
user    0m15.140s
sys     0m6.100s

2)I cannot enforce any changes on the production mail server farm for the 
LDAP upgrade

Maybe you aren't indexing objectclass?

Regards,
Buchan