B
botfood
I would like to know more about how perl uses memory when managing a
hash that is tie()ed to a file on disk. Using DB_File and variable
length records....
I have an application where the DB file gotten quite big, not giant,
but around 20k records and is a file about 11MB in size. My
understanding of DB_FIle is that while there is no programtic limit on
the number of records, there may be memory-driven limits depending what
one does with the hash. Looping thru the keys is still fast and so the
number of records doesnt seem to be a problem.
In this particular case, each record is not that big, except for one
specific type of 'book-keeping' record that is used to keep track of
what records are considered 'complete' by this particular application.
With a couple reports, I need to whip thru all complete records
searching for various things.... And in another spot I know that the
code looks for matches within this big record that contains around 20k
'words' consisting of about 20 digits.
what I am wondering is whether it is likely that the simple number of
records eats up large amounts of memory just by being tie()ed, or if it
is more likely that this one particular internal index record is
causing me problems when it gets pulled into memory to do things like
m// or s// on its contents to find or edit a 'word' which is simply a
list of the keys having a specific status.
The next part of the question is.... if it sounds like a large internal
indexing record is likely to be a problem, what would some recommended
techniques be to break that out? should I create a separate DB file to
use as an index? I am really wondering how best to 'fake' large
database capabilities to manage keeping track of status without eating
tons of memory.
TIA,
d
hash that is tie()ed to a file on disk. Using DB_File and variable
length records....
I have an application where the DB file gotten quite big, not giant,
but around 20k records and is a file about 11MB in size. My
understanding of DB_FIle is that while there is no programtic limit on
the number of records, there may be memory-driven limits depending what
one does with the hash. Looping thru the keys is still fast and so the
number of records doesnt seem to be a problem.
In this particular case, each record is not that big, except for one
specific type of 'book-keeping' record that is used to keep track of
what records are considered 'complete' by this particular application.
With a couple reports, I need to whip thru all complete records
searching for various things.... And in another spot I know that the
code looks for matches within this big record that contains around 20k
'words' consisting of about 20 digits.
what I am wondering is whether it is likely that the simple number of
records eats up large amounts of memory just by being tie()ed, or if it
is more likely that this one particular internal index record is
causing me problems when it gets pulled into memory to do things like
m// or s// on its contents to find or edit a 'word' which is simply a
list of the keys having a specific status.
The next part of the question is.... if it sounds like a large internal
indexing record is likely to be a problem, what would some recommended
techniques be to break that out? should I create a separate DB file to
use as an index? I am really wondering how best to 'fake' large
database capabilities to manage keeping track of status without eating
tons of memory.
TIA,
d