[NTLUG:Discuss] db vs flat file

David Camm bbai at onramp.net
Fri Dec 14 15:05:25 CST 2001


i'm about to write some code to do a search based on condtions among
several fields in records in a file.

i can use either a flat file or a hash version of the file.

as the file gets larger (multiple thousands of records) will it be
faster to: 

open(I, 'inputfile'); while (<I>) { .......} close (I); 

or:

tie (%D .... input.db...) while (($k,$v) = each %D){ .....} untie %D;

my ***GUESS*** is that dbm support contains more code than sequential
file support and hence might be slower, but that's just a guess.

any opinions (or hard facts) would be greatly appreciated.

david camm
advanced web systems




More information about the Discuss mailing list