Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DB_File question...

Status
Not open for further replies.

photores

Programmer
Sep 12, 2000
13
0
0
RU
Hi!
Known anyone, how I can modify tied file size. I need save to db file small values (for example: key - 10 char, value - 30 char), but file is very large, approx 8kb empty and it quick enlarging...
 
I think the way tied files are created they always start out about 8Kb. Unless you are adding a LOT of records it shouldn't grow too much larger than that. 8Kb really isn't that large. How big is it quickly enlarging to?
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
For example I make loop:

tie %h, "DB_File", $file, O_RDWR|O_CREAT, 0640, $DB_HASH or die "Cannot open file $file: $!\n";


for($i = 0;$i < 10;$i++) {
$h{$i} = 'value';
}
untie %h;

Result file is 40 kb. I think, it is too large :-(
 
That does sound unnecessarily large, but other than using some other database or a flat text file, I'm not sure there's much you can do about it. How many key/value pairs do you expect to have to store?
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
I try writing &quot;pseudo relation&quot; database module and planning use DB_File for easy index creation and access. But with DB_File my index files sizes will be larger as tables :)
When I start writing this project, I was use MLDBM module for this, and my code was worked exselent quick, and files had good size :)
But in many systems is not installed MLDBM, and I try use for it DB_File... :-(
I planning use my module with tables up to 500 - 1000 enteries.
Another database, such as MySQL is not allowed. I write module for use with sistems where not installed another databases.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top