Forms, print queues and tdb

Damian Ivereigh damian at
Wed Jan 10 12:50:36 GMT 2001

I am noticing that there are several times where Samba is doing a
serial search through all the keys in a tdb file. The main reason
seems to be that because tdb uses hashes, you can only go to a certain
key, you can't do a subkey match.

For example the print jobs are stored in the printing.tdb file.
However the print queue name is not part of key, but even if it was
you could not say "give me all the records that match the partial key
that corresponds to this printer". So the Samba ends up doing a
tdb_traverse picking up every single job and seeing if it matches this

A similar thing happens around forms - since there is no way to match
keys that begin with "FORM/", you end up having to do a traverse
through the entire file, very slow when there are a lot of forms and a
lot of drivers to wade through.

The only solution I can see is to either have a seperate tdb file for
each print queue (and a seperate one for the forms), or to use some
method of indexing that gives a sorted order and therefore allows
partial matches - e.g. one of the b-tree algorithms. So how attached
is everyone to tdb? Can anyone think of a better solution? Is my brain

Damian Ivereigh
CEPS Team Lead
Desk: +61 2 8446 6344
Mob: +61 418 217 582

More information about the samba-technical mailing list