Kbase 15006: Why your db may continue to grow in size after deletions
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
Why your db may continue to grow in size after deletions
A fairly common question we receive is, "If Progress reuses space in
the database, why is my database continuing to grow after we have
deleted a significant portion of the data?"
The only way for your database to decrease in size is to do a dump and
load**. However, Progress will reuse space that has been freed up by
means of deletions.
This is how:
There are three blocks in question. The RM (Record Management) blocks
contain your data. We try to leave 75 bytes free in each block to
allow for expansion in the event that the record is updated in the
future. This is to reduce the number of records that are split across
multiple blocks.
The RM Chain blocks are neither full nor empty. If a block has at
least 250 bytes free (150 for systems with 512 byte blocks), then
the block is put on the RM Chain.
The Free Chain blocks are empty, Progress formatted blocks. These
blocks are available to be allocated as either index blocks or
data blocks.
Each block within Progress is equal to the size of an OS block.
Under DOS it is 512 bytes, under most Unix system is is 1024 bytes,
under Sequent, Pyramid, VAX Ultrix, VMS and Nixdorf systems it is
2048 bytes.
The blocks on the RM Chain are there due to the creation of records
leaving a block partially full, or the deletion of records leaving
the block partially empty. Either way, this block can hold more data
and is therefore left on the RM Chain. Once it is completely full
(still allowing for expansion space) or completely empty it is
popped to the RM blocks or the Free Chain respectively.
After many deletions, there are now many blocks on the RM Chain.
When you attempt to then create a new record, Progress will search the
RM Chain for a place for the new record. We will make three attempts
to place the record completely in the remaining space of a block on
the RM Chain, looking at the first three blocks. If there is room
in any of the first three blocks to hold the entire record, the record
is placed and the operation is finished. If there is not enough space
in the first three blocks, we will grab a block from the Free Chain
and move it to the RM Chain, and put the record in this block. If the
record is larger than 1 block, we will grab another block from the
Free Chain to hold the overflow. The first block that we searched
in the RM Chain is then moved to the bottom of the RM Chain so that
the same three blocks are not continued to be searched.
To answer the question:
If your records are all greater than the size of 1 block on your OS
then you will not be able to reuse the space on the RM Chain since
the remaining space is less than or equal to the size of 1 block. This
will cause Progress to grab blocks from the Free Chain to load your
records which will cause the database to grow. When the number of Free
Chain blocks becomes low, the database will extend to grab more blocks
for the Free Chain.
**Although a dump and load is the only way to decrease the size of
your database, it can at times make the size of your database larger.
This is to ensure that there is room for growth within each block.
Below is a listing of the block sizes for different systems and the
space allowed by Progress for expansion:
Block Size (bytes) Space For Expansion Operating System
------------------ ------------------- ----------------
512 15% DOS, OS/2, NLM
2048 4% Pyramid, Sequent,
VAX Ultrix, VMS,
Nixdorf
1024 7% All others
If blocks have less than the required amount of free space to
allow for expansion, then a dump and load can actually make the
db larger. This can happen because in recreating the blocks we
will create the block leaving the percentage listed above free
for expansion.
You can use "proutil <dbname> -C dbanalys" to get some information
about how well or poorly space is being utilized.
Progress Software Technical Support Note # 15006