B
botfood
I am working on a DB cleanup tool that purges records from a tie()ed
file created with DB_File. I have a first pass done on the tool, and
seems to be functioning. On a test DB it correctly reports that it
found about 2500 'old' records according to my criteria,and deleted
them...
problem is that the file itself, which was about 10.3MB for 14k
records, did not change size after 2500 records were deleted. I sort of
expected some reduction in file size?!
Is there some kind of 'compact' or cleanup utility that I need to run
on the database to squeeze out the empty holes or something?
snippets shown... not working code
=======
....
use DB_File;
tie ( %tempHash , 'DB_File' , "${cfgRelPath_cgi2DB}/${dbfile}" ) ;
then later in a loop I delete a specific record with something like
this
delete($tempHash{$tempKey}) ;
=================
file created with DB_File. I have a first pass done on the tool, and
seems to be functioning. On a test DB it correctly reports that it
found about 2500 'old' records according to my criteria,and deleted
them...
problem is that the file itself, which was about 10.3MB for 14k
records, did not change size after 2500 records were deleted. I sort of
expected some reduction in file size?!
Is there some kind of 'compact' or cleanup utility that I need to run
on the database to squeeze out the empty holes or something?
snippets shown... not working code
=======
....
use DB_File;
tie ( %tempHash , 'DB_File' , "${cfgRelPath_cgi2DB}/${dbfile}" ) ;
then later in a loop I delete a specific record with something like
this
delete($tempHash{$tempKey}) ;
=================