19.06.2013 Views

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

► The data is accessible but until the table space is reorganized a per<strong>for</strong>mance penalty is<br />

paid.<br />

► Plans, packages and cached dynamic statements referring to the changed column are<br />

invalidated. If auto-rebind is enabled, the plans and packages referencing the changed<br />

table space are automatically rebound during the next access if not manually rebound<br />

previously.<br />

► Frequency statistics <strong>for</strong> columns are invalidated.<br />

► The new column type must be large enough to hold the maximum value possible <strong>for</strong><br />

original column.<br />

► If indexed, changes <strong>for</strong> character data type columns result in immediate index availability.<br />

This includes columns defined as CHAR, VARCHAR, GRAPHIC, or VARGRAPHIC.<br />

► If indexed, changes <strong>for</strong> numeric data type columns are immediate with delayed index<br />

availability. This includes columns defined as SMALLINT, INTEGER, DECIMAL or<br />

NUMERIC, FLOAT, REAL, or DOUBLE. Availability to the index is delayed until the index is<br />

rebuilt.<br />

► Scope of unavailability <strong>for</strong> dynamic SQL<br />

– Deletes are allowed <strong>for</strong> table rows, even if there are indexes in RBDP.<br />

– Updates and inserts are allowed <strong>for</strong> table rows, even if their corresponding non-unique<br />

indexes are in RBDP state.<br />

– Inserting or updating data rows which result in inserting keys into an index that is in<br />

RBDP state is disallowed <strong>for</strong> unique or unique where not null indexes.<br />

– For queries, <strong>DB2</strong> does not choose an index in RBDP <strong>for</strong> an access path.<br />

Recommendations<br />

When using this feature, make sure that you do not <strong>for</strong>get to assess which programs need to<br />

be changed. Host variables, <strong>for</strong> example, may need to be extended to cater to the extra<br />

length. To minimize any per<strong>for</strong>mance degradation, schedule a REORG as soon as possible<br />

after ALTER. This reestablishes fast column processing and eliminates the conversion from<br />

old row <strong>for</strong>mat to the new one when retrieved by the application.<br />

Rebuild any affected indexes and rebind plans and packages. Otherwise <strong>DB2</strong> might pick an<br />

inefficient access path during automatic rebind because the best suited index is currently not<br />

available.<br />

Schedule RUNSTATS to repopulate the catalog with accurate column and index statistics.<br />

Alter index<br />

Several changes can now be implemented via the ALTER INDEX statement:<br />

► Add a column to the end of an index<br />

Adding the column to the table and index in the same UOW will place the index in AREO*<br />

state. The index is immediately available.<br />

Adding an existing column to the index places the index in rebuild pending (RBDP) status.<br />

► Scope of unavailability <strong>for</strong> dynamic SQL<br />

Deletes are allowed <strong>for</strong> table rows, even if there are indexes in RBDP.<br />

Updates and inserts are allowed <strong>for</strong> table rows, even if their corresponding non-unique<br />

indexes are in RBDP state.<br />

Inserting or updating data rows which results in inserting keys into an index that is in<br />

RBDP state is disallowed <strong>for</strong> unique or unique where not null indexes.<br />

Chapter 5. Availability and capacity enhancements 231

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

Saved successfully!

Ooh no, something went wrong!