Re: [Exim] DB3 errors on lookup (solved); performance ?

Top Page
Delete this message
Reply to this message
Author: Greg Ward
Date:  
To: exim-users
Subject: Re: [Exim] DB3 errors on lookup (solved); performance ?
On 17 August 2001, John Dalbec said:
> Which performs better for largish (60,000 records) databases, HASH or
> BTREE?


That depends on what you're doing with it; what I learned in my computer
science classes is that Btrees are useful when you need to access data
in order (either iterating or searching), but hashes should perform
better for simple lookups. Looking up a key in a Btree is O(lg N),
while lookup in a hash is O(1). Of course cold hard reality can screw
all that up with degenerate trees, lousy hashing functions, and so
forth. I'm inclined to give Berkeley DB the benefit of the doubt and
assume they've done it right.

I suspect Exim mostly does simple lookups -- is this an allowed domain?
what does alias "foo" expand to? etc -- so a hash would presumably be
better.

        Greg
-- 
Greg Ward - software developer                gward@???
MEMS Exchange                            http://www.mems-exchange.org