hi,everyone. a problem with shelve Module

S

softwindow

according to the book instruduction , i use shelve Module to write
record to file.

i only write ten records like this:

name sex age

jim male 22
tom male 23
lucy female 21

..................................................others( about ten
records)

but i find the size of this file .oh my god , it is about 24k

the file is too large ! is it normal ?

i don't dare to think that if i has 1000 records , it will be a very
large file!
 
S

skip

...

Yes. It's the nature of packages like Berkeley DB, gdbm and dbm (the
packages mediate access to the database file under the covers) that they
trade space for time. The files they create are not simple text files.
They are organized to permit quick access to records by key and to permit
average time fast insertion.

Skip
 
L

Laszlo Nagy

(e-mail address removed) i'rta:
Yes. It's the nature of packages like Berkeley DB, gdbm and dbm (the
packages mediate access to the database file under the covers) that they
trade space for time.
Sometimes you add records but the size of the database does not
change... :)
 
J

Jim Segrave

Sometimes you add records but the size of the database does not
change... :)
really

in which case?[/QUOTE]

whenever the database is big enough to add them without it's having to
grow :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top