ldb speed

simo idra at samba.org
Mon Oct 30 22:18:06 GMT 2006

On Tue, 2006-10-31 at 08:53 +1100, tridge at samba.org wrote:
> Simo,
>  > Well, consider a person that drags 100 users from an OU to another.
>  > And consider updating 5000 groups 100 times ...
> yes, I have considered it. Lets do the math.
> Within a transaction we have no locking. All operations happen
> in-memory. That means we are running at the "lockless" tdb speed,
> which is about 6 usec/op. So even if we did it in that horribly
> inefficient way you suggest it would take 500000*6usec = 3 seconds.

> But we won't do it the way you suggest. It can obviously be done in a
> single pass over the database. How long does it take us to do a single
> pass over (say) 50000 records? It takes about 0.3 seconds. That is an
> entirely acceptable time for an operation initiated by the user
> dragging something in a GUI.

This holds true if you move one OU, but if you move 100 objects (select
and drag) you have 100 renames. So you end up with the inefficient way.

3 seconds for such operation via the GUI are probably still acceptable,
I agree.

> Now compare that to adding an extra tdb operation on every ldb
> fetch. How many ldb searches do we do between the times when the admin
> drags around those users in the GUI ? A million? More? 
> It is not worth slowing down very common operations to make very
> uncommon operations go fast. 

I agree on this principle, just trying to find out what's best.
For example, how do you deal with references outside the tree?
We may just choose to ignore these, but than we may have to deal with
broken refs, or worst the wrong object (after 2 renames a->b c->a)


Simo Sorce
Samba Team GPL Compliance Officer
email: idra at samba.org

More information about the samba-technical mailing list