db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Matrigali <mikem_...@sbcglobal.net>
Subject [PATCH] 1st phase submission to address DERBY-132 inline compress of tables
Date Fri, 08 Apr 2005 16:24:25 GMT
The following is the 1st phase of a checkin to address DERBY-132 - 
request to add an inplace compress.

This checkin addresses the issue in 3 parts:

1) Code has been added to purge committed rows from heap tables.
    This code uses the same basic algorithm to identify and purge
    committed deleted heap rows that currently exists.  It scans the
    entire heap table in the current thread processing all rows.

2) Code has been added to defragment remaining rows in the page, freeing
    pages at the end of the table.
    This code scans the table and moves rows from the end of the heap table
    toward the front of the table.  For every row moved all index entries
    must be updated after the move.  The allocation system is updated to
    put new rows toward the front of the table.  After it is finished there
    will be a chunk of empty pages at the end of the file.

3) Code has been added to return the free space at the end of the table
    back to the OS.
    Finds the chunk of empty pages at the end of the file.  Updates the
    Allocation data structures to remove the chunk of pages at the end.
    Calls the JVM to return the space at the end of the file back to the

4) In order to test all of these paths a new system procedure,
    SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE has been added.  Eventually
    as a zero admin database the system should call this routine internally.
    It allows each of the 3 above described phases to be called either
    individually or in sequence.

This checkin has passed all exising derby tests, and passes some new tests
that have been added.  There is more work to do, which I will be doing
right away.

Short term TODO (next month or so):
1) much more extensive testing.
2) Add btree purge support.
3) Add btree free space compress support.
3) improve concurrency of reclaim paths, allow for background processing 
    locks held for very short time - on the order of the time it takes to
    process a page worth of data.

longer term (not sure when)
1) Add btree defragment support.
2) automatically call compresser.

View raw message