Availability and Compression of Free Space in a Data Block

oracle_ace發表於2008-01-08

對於data block中的free space的機制論述如下:
----------------------------------------------------------------
Two types of statements can increase the free space of one or more data blocks:
DELETE statements,
UPDATE statements that update existing values to smaller values.
The released space from these types of statements is available for subsequent INSERT statements under the following conditions:
(DELETE和UPDATE可以release我們data block中的free space,而這些release的free space可以被後繼的Insert statement使用)

1.If the INSERT statement is in the same transaction and subsequent to the statement that frees space, then the INSERT statement can use the space made available.
(如果後繼的Insert statement和delete以及update等語句處於同一個transactions,那麼insert statement就可以直接使用這些release的free space)

2.If the INSERT statement is in a separate transaction from the statement that frees space (perhaps being run by another user), then the INSERT statement can use the space made available only after the other transaction commits and only if the space is needed.
(如果後繼的Insert statement和delete以及update等語句處於不同的 transactions,那麼只有當這些release free space的transaction被commit,且釋放了free space空間後,後繼的insert statement才可以使用)

Released space may or may not be contiguous with the main area of free space in a data block. Oracle coalesces the free space of a data block only when
(1) an INSERT or UPDATE statement attempts to use a block that contains enough free space to contain a new row piece.
(2) the free space is fragmented so the row piece cannot be inserted in a contiguous section of the block. Oracle does this compression only in such situations, because otherwise the performance of a database system decreases due to the continuous compression of the free space in data blocks.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12361284/viewspace-119546/,如需轉載,請註明出處,否則將追究法律責任。

相關文章