ldb speed

tridge at samba.org tridge at samba.org
Mon Oct 30 21:53:03 GMT 2006


 > 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.

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. 

Cheers, Tridge

More information about the samba-technical mailing list