: (e-mail address removed)-berlin.de wrote:
: >
: > : The AnyDBM_File POD includes a comparison table:
: > :
http://search.cpan.org/perldoc?AnyDBM_File
: >
: > Hi Gunnar,
: >
: > I consulted that table (which I had seen earlier), it says:
: >
: > odbm ndbm sdbm gdbm bsd-db
: > ---- ---- ---- ---- ------
: > Database Size ? ? small big? ok[1]
: >
: > I must confess that I cannot really accept 16MB for 19000 strings
: > filling 500kB as flat file, as "small". The keys are all six ASCII
: > characters "long".
: I agree, in that in my experience SDMB has ballooned a flat file by
: factors of perhaps 3 to 7 or so, not the factor of 32 you are reporting.
: But SDBM is pretty rudimentary, and who knows what a near worst-case set
: of keys could produce.
Well, it looks as if the answer is hidden here. The keys I use are
strictly consecutive in order, running from "0001.1" to "4973.4" with
the digit after the dot being in a range of [1..4]. Perhaps some scrambling
on my side will produce seemingly "random" (but still unique) keys which
will make a smaller SDBM file? Sounds worth trying.
: You didn't do anything like copy the SDBM file
: in from another OS or an older version of Perl (or another DBM-type
: [shudder]), did you?
No no. I use AS Perl 5.8.0 and a
tie (%mongol, 'SDBM_File', 'mongdb', O_RDWR|O_CREAT, 0666)
or die "Couldn't tie SDBM file 'mongdb': $!; aborting.\n";
statement, and then initially fill the hash %mongol at the first run
with data from a keyed list with approx. 19000 entries.
: There is no guarantee of portability with any
: DBM-type file, even between machines with the same OS and Perl version
: (the admin who set up the system could have configured different
: parameters for two different systems). If the contents are to be
Data porting is not an issue, the plain, flat ASCII list is my transport
format of choice in this particular case.
: One other possibility: Are you using a DBM-type tied hash in
: a CGI application without proper locking? Proper locking is essential.
No, just a plain single-user GUI.
: I don't think you'll find any of the Unix-specific DBM's ported to
: Windows. Gunnar was suggesting DB_File, which is standard (that means
: "comes with") ActiveState Perl in all recent versions. In fact, I think
: maybe it is the default for dbmopen/dbmclose these days, instead of
: SDBM. Try that as he suggested. See:
: perldoc DB_File
Won't work on a AS Perl 5.8.0 WinXP installation!
Thank you a lot for the comments and discussion,
Oliver.