10.07.2015 Views

Expert Oracle Exadata - Parent Directory

Expert Oracle Exadata - Parent Directory

Expert Oracle Exadata - Parent Directory

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 3 HYBRID COLUMNAR COMPRESSIONNote that the row header may contain a pointer to another row piece. We’ll come back to this a littlelater, but for now, just be aware that there is a mechanism to point to another location. Also note thateach column is preceded by a separate field indicating the length of the column. Nothing is actuallystored in the Column Value field for nulls. The presence of a null column is indicated by a value of 0 inthe column length field. Trailing nulls don’t even store the column length fields, as the presence of a newrow header indicates that there are no more columns with values in the current row.PCTFREE is a key value associated with blocks; it controls how space is used in a block. Its purpose isto reserve some free space in each block for updates. This is necessary to prevent row migration (movingrows to new blocks) that would be caused by lack of space in the row’s original block when a rowincreases in size. When rows are expected to be updated (with values that require more space), morespace is generally reserved. When rows are not expected to increase in size because of updates, values aslow as 0 may be specified for PCTFREE. With compressed blocks it is common to use very low values ofPCTFREE, because the goal is to minimize space usage and the rows are generally not expected to beupdated frequently (if ever). Figure 3-3 shows how free space is reserved based on the value of PCTFREE.Free Space20 %20 % of the space in thebolck is reserved forupdates to existing recordsDatabaseBlockRow DataPCTFREE = 20Figure 3-3. Block free space controlled by PCTFREEFigure 3-3 shows a block that reserves 20 percent of its space for updates. A block with a PCTFREEsetting of 0 percent would allow inserts to fill the block almost completely. When a record is updated,and the new data will not fit in the available free space of the block where the record is stored, thedatabase will move the row to a new block. This process is called row migration. It does not completelyremove the row from the original block but leaves a reference to the newly relocated row so that it canstill be found by its original rowid (which basically consists of a file number, block number, and rownumber within the block). This ability of <strong>Oracle</strong> to relocate rows will become relevant when we discusswhat happens if you update a row that has been compressed. Note that the more generic term forstoring rows in more than one piece is row chaining. Row migration is a special case of row chaining inwhich the entire row is relocated. Figure 3-4 shows what a block with a migrated row might look like.67

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!