dbTalk Databases Forums  

Database file fragmentation

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss Database file fragmentation in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sergey Maslyakov
 
Posts: n/a

Default Database file fragmentation - 05-17-2006 , 03:09 PM






Did I get it right from the documentation and the discussions on the
web/newsgroups that BDB will reuse space released by deleted records
but only if there is a whole page of deleted records? Or would it be
more appropriate to say that in *never* reuses the space in the data
file "occupied" by deleted records?


Thanks!
/Sergey


Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default Re: Database file fragmentation - 05-18-2006 , 04:10 PM






Sergey,

Space is reusable on database pages as soon as a record is deleted.
Other records that physically belong on that page may use that space.
A database page is normally made available to be reused within the
database file when all the records on that page are deleted. Deleted
records do not occupy space unless there is a cursor posistioned on the
record at the time of its deletion.

Michael Ubell
Sleepycat Software.


Reply With Quote
  #3  
Old   
Mike
 
Posts: n/a

Default Re: Database file fragmentation - 05-18-2006 , 07:15 PM



On May 18, 2006, at 4:22 PM, <sergey.maslyakov> wrote:

Hi Michael,

I did not quite understand what is the smallest reusable entity? Is it
a
record, given that a newly inserted record is not bigger in size than
the deleted one? Or, is it a page that contains only deleted records?

Let's say, I have a Btree-indexed table that has fixed-length records.
I
delete random records and insert new ones. Should I expect the new
records to be put in place of the deleted ones; thus, reduce the need
to
salvage the database?


Thanks!
/Sergey

===========================

The smallest resuable entity is a byte. The DB_BTREE access method
does not support fixed length records. The DB_RECNO access method does
support fixed length records but even there allocation on the page is
done on the byte level.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.