Row Migration:
Row migration refers to rows that were moved to another block due to an update making them too large to fit into their original blocks. Oracle will leave a forwarding pointer in the original block so indexes will still be able to find the row. The rowid of the migrated row does not change. Thus, ROWID which is stored in the index still refers to the old location of the row. An additional block, the new location of the row, must be read to fetch the required data.
Row Chaining:
A chained row is a row that is too large to fit into a single database data block. For example, if you use a 4KB blocksize for your database, and you need to insert a row if 8KB into it, Oracle will use 3 blocks and store the row in pieces.
Oracle has provided three ways to detect the Row Chaining and Row Migration.
- The ANALYZE command
- The dynamic views
- Report.txt method
Total Number of table fetch continued row since instance startup?
How many Rows in a Table are chained?
List Chained Rows
How to Avoid Chained and Migrated Rows?
1. Alter Table Move
2. Rebuild the Indexes for the Table
Detect all Tables with Chained and Migrated Rows
Conclusion: Migrated rows affect OLTP systems which use indexed reads to read singleton rows. In the worst case, you can add an extra I/O to all reads which would be really bad. Truly chained rows affect index reads and full table scans.
- Row migration is typically caused by UPDATE operation
- Row chaining is typically caused by INSERT operation.
- SQL statements that are creating/querying these chained/migrated rows will degrade the performance due to more I/O work.
- To diagnose chained/migrated rows use ANALYZE command, query V$SYSSTAT view
- To remove chained/migrated rows use higher PCTFREE using ALTER TABLE MOVE.
No comments:
Post a Comment