Row Chaining, Row Migrating, PCTFREE, PCTUSED

Row Chaining  

The row is too large to fit into an EMPTY data block that is known as chained row. Oracle stores the data for the row in a chain of data blocks (one or more) reserved for that segment. If  you have a 2k blocksize but your row size is 4k, we will use 3 blocks to store that row in pieces.  Any table with a long/long raw will have chained rows.Row chaining most often occurs with large rows, such as rows that contain a column of datatype LONG or LONG RAW. Row chaining in these cases isnot avoided. Any table whose rowsize exceeds the  blocksize will have chained rows.  Any table with more then 255 columns will have chained rows.You can see if you "have it" by looking at the system wide statistic:

select * from v$sysstat where name like 'table pop cont%';

Row Migrating

A row that was moved to another block due to an update making it too large to fit on its original block with the other rows there is known as migrated row.Oracle tries to find another Blockwith enough free space to hold the entire row.If such block is available Oracle moves the entire ROW to the NEW BLOCK.Oracle keeps the original Row piece of a Migrated row row to POINT to the NEW BLOCK containing the actual row.The ROWID of the MIGRATED rows does not change. INDEXES are not updated and they point to the ORIGINAL row LOCATION.

Migration and Chaining have negative effects on performance. INSERT and UPDATE statements that cause migration and chaining perform very poorly since due to additional PROCESSING. Queries that use an Index to select migrated or chained rows must perform additional I/O's.
 
PCTFREE Parameter

The PCTFREE parameter specifies the minimum percentage of data block to be reserved as free space. If you used PCTFREE 20 then at least 20% size of data block will be reserved as free space. For example if you use data block size 8K (DB_BLOCK_SIZE=8192) then PCTFREE 20 will reserved 1638 bytes as free space in a data block. This parameter is used to update to the existing rows already within each block.You can specify this parameter which issuing CREATE TABLE statement.
   

 

PCTUSED Parameter

This parameter specifies the minimum percentage of a block that can be used for row data plus overhead(data block header, table directory, and row directory) before new rows are added to the block.

After a data block is filled to the limit determined by PCTFREE, Oracle considers the block unavailable for the insertion of new rows until the percentage of that block falls below the parameter PCTUSED.

If we set PCTUSED 40 in the CREATE TABLE statement then data block used for this table's data segment is considered unavailable for the insertion of any new rows until the amount of used space in the block falls to 39% or less (Here the block's used space has previously reached PCTFREE).
Related Post:- Row Format

People who read this post also read :



8 comments:

Thank you very much.
This is very simple and nice way to understand the row chaining and row migration.You should update the page with the information about freelist.

Your discussion about row migrating is very clear to understand and we get the best point from here about row changing.
Write my essay for me cheap UK

Nice tips and details for a starting Row Chaining blog. I really like all your exclamation points. For sponsored blog posts I wanted to know people generally look for traffic but when we just start a new blog at that time traffic is less. How can we get a sponsored blog post at that time? I tried approaching some people but got a big No. If you can help me suggest something with that I will be great. Source:
The Web Design Jack

This comment has been removed by the author.

Thank you so much for everything.
This is a really easy and pleasant approach to comprehend row chaining and row migration.
You should update the page with the freelist information.
Source :
Web Design Jack

Thank you so much for everything.
This is a really easy and pleasant approach to comprehend row chaining and row migration.
You should update the page with the freelist information.
Source : toilet latch child safety toilet latch

This comment has been removed by the author.

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More