[SSSD] [PATCH] Optimize gorup enumerations

Simo Sorce ssorce at redhat.com
Wed Nov 18 01:38:00 UTC 2009


I've been thinking about optimizing group enumerations for a while as
they were way too slow for my taste.

I did that by relying on the way we store users in the database and by
parsing the member attribute of the groups counting on the fact we build
the user dn as name=<username>,cn=users,....

This patch does indeed help a lot as the speedup with a large database
is huge, on my machine the reduction is of at least 1 order of magnitude
(from 2.5 seconds to 0.15 seconds)
With this patch we do one search only ( therefore O(n) ) instead of a
series of searches ( O(n^2) ).
I also removed a lot of code, which is usually also a good thing.


The downside is that I don't have a user entry to test for uid range, so
I can't exclude users based on that.

However I think we should move both name filtering and range filtering
in the backend code and enforce them once at store time instead of
testing and enforcing them again and again and again each time we query
the database.

If the range or list of filtered name changes we should catch that by
simply filtering the database when the settings change and at startup.

Comments are welcome.

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Optimize-sysdb_enumgrent.patch
Type: text/x-patch
Size: 32135 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20091117/17395aae/attachment.bin>


More information about the sssd-devel mailing list