z/VSE: 45 Years of Progress - z/VM - IBM
z/VSE: 45 Years of Progress - z/VM - IBM
z/VSE: 45 Years of Progress - z/VM - IBM
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
is concerned with minimizing locking<br />
and contention issues and providing<br />
current data to applications as quickly<br />
as possible.<br />
There are several scenarios where an<br />
application requires high data availability;<br />
those that call for high-speed data<br />
update and retrieval (perhaps in a 24x7<br />
environment), include a data archiving<br />
or data retention process, or require<br />
coordinated DB2 utility execution with<br />
SQL access.<br />
In each <strong>of</strong> these cases, there are database<br />
design choices that may alleviate<br />
future contention problems. The most<br />
common design solutions involve combinations<br />
<strong>of</strong> horizontal and vertical data<br />
partitioning with a method <strong>of</strong> assigning<br />
clustering keys. Such a solution helps<br />
avoid data hot spots, which are areas in<br />
memory and on DASD where multiple<br />
I/Os from multiple transactions may<br />
cause contention or locking issues.<br />
Horizontal partitioning is the separation<br />
<strong>of</strong> table rows into two or more<br />
physical data sets. It may be accompanied<br />
by a similar physical partitioning<br />
<strong>of</strong> some indexes. DB2 partitioned tables<br />
let the designer choose a row storage<br />
strategy based on the partitioning.<br />
Horizontal partitioning will affect the<br />
database backup and recovery methods<br />
and elapsed times. Figure 2 lists some<br />
strategies and their usefulness.<br />
Vertical partitioning involves splitting<br />
a table vertically—designating some<br />
columns to remain in the table while<br />
others are moved to another table or<br />
tables. In this way, a single table is<br />
denormalized into two or more tables,<br />
each containing a subset <strong>of</strong> columns<br />
from the original. This is usually accompanied<br />
by replicating the primary key <strong>of</strong><br />
the original table across all the resulting<br />
tables. To re-create an original row, the<br />
tables must be joined on their primary<br />
key columns. The DBA usually chooses<br />
vertical partitioning for performance<br />
reasons; Figure 3 lists additional decision-making<br />
factors.<br />
Key clustering is a technique the<br />
DBA uses to ensure inserted rows don’t<br />
create hot spots in the data. One common<br />
way this happens is when new<br />
records are assigned a key based on a<br />
sequentially ascending value (such as an<br />
identity column or a sequence) and the<br />
table is clustered on this key. The result<br />
is that newly inserted rows are added at<br />
the physical end <strong>of</strong> the table.<br />
Assuming the DBA implements<br />
page-level locking, a row insert requires<br />
an exclusive lock on the page where the<br />
row is placed, and the lock is kept until<br />
z / J o u r n a l • O c t o b e r / N o v e m b e r 2 0 1 0 • 3 3