Beruflich Dokumente
Kultur Dokumente
Sanjay Rajput
Indexing and Clustering
Let’s check out some of the important highlights of the concept of indexing and
clustering.
Points to Mind:
4) The costs of changing indexes are often more than the costs of changing the
data.
5) Primary keys and foreign keys are often searched or joined over a small
percentage of rows and are good candidates for indexes. Indeed, the
primary key must have a unique index to guarantee unique values in the
column.
7) When a row is deleted from a parent table and no index exists on the
foreign key, it is necessary to do a table space scan on each dependent table
to enforce the delete rule.
8) Joins are often performed on the primary key and foreign key columns;
therefore, an index on these columns makes the join much more efficient in
most cases.
10) The optimizer is likely to use the clustering index to avoid a sort for
ORDER BY, GROUP BY, DISTINCT, and join processing.
11) Columns frequently searched or joined over a range of values using the
operators BETWEEN, >, <, and LIKE are good candidates for clustering.
12) A clustering index means that values are maintained in sequence on the
data pages.
13) The REORG utility does not re sequence rows, if a clustering index is not
explicitly declared.
15) SORTDATA required 74 percent less elapsed time when reorganizing data
with a cluster ratio of 80 percent in one case.
16) If equal predicates are used on a column with a unique index, clustering
has no advantages.
18) Minimize the number of indexes when inserting, updating, and deleting
more than about 10 percent of the rows on a weekly basis.
19) Composite indexes are useful when columns are frequently referenced
together.
20) In most cases, indexes should be created after a table is created and before
the
LOAD utility is used to populate the table.
21) The LOAD utility builds the indexes after extracting the indexed values
while inserting rows into the table.
23) If a table already has rows when an index is created, a table space scan is
performed to extract the indexed values.
24) For data accessed sequentially, cluster ratio has a huge impact on
performance for randomly accessed data, cluster ratio is not as important.
26) A value of 'Y' in the CLUSTERING column indicates that the row
describes the clustering index.
Hope these points would be quite helpful for you all as an introduction to the
concept of Indexing and clustering for a performance tuning exercise.