ITPub博客

首页 > IT职业 > IT生活 > Cluster Learning

Cluster Learning

原创 IT生活 作者:zhycjun 时间:2007-09-29 10:35:26 0 删除 编辑

Definition of Clusters
A cluster is a group of one or more tables that share the same data blocks because they share
common columns and are often used together in join queries. Storing tables in clusters offers
the DBA a method to denormalize data. Clusters are transparent to the end user and
programmer.
Performance Benefits of Clusters
• Disk I/O is reduced and access time improved for joins of clustered tables.
• Each cluster key value is stored only once for all the rows of the same key value; it
therefore uses less storage space.
Performance Consideration
Full table scans are generally slower on clustered tables than on nonclustered tables.

Cluster Types
Index Clusters
An index cluster uses an index, known as the cluster index, to maintain the data within the
cluster. The cluster index must be available to store, access, or maintain data in an index
cluster.
The cluster index is used to point to the block that contains the rows with a given key value.
The structure of a cluster index is similar to that of a normal index.
Although a normal index does not store null key values, cluster indexes store null keys.
There is only one entry for each key value in the cluster index. Therefore, a cluster index is
likely to be smaller than a normal index on the same set of key values.
Hash Clusters
A hash cluster uses a hash algorithm (either user-defined or system-generated) to calculate
the location of a row, both for retrieval and for DML operations.
For equality searches that use the cluster key, a hash cluster can provide greater performance
gains than an index cluster, because there is only one segment to scan (no index access is
needed).

Situations Where Clusters Are Useful
When Not to Use Clusters
• If a full scan is executed often on one of the clustered tables: This table is stored on
more blocks than if it had been created alone.
• If the data for all rows of a cluster key value exceeds one or two Oracle blocks: To
access an individual row in a clustered key table, the Oracle server reads all blocks
containing rows with the same value.
When Not to Use Hash Clusters
• If the table is constantly growing and if it is impractical to rebuild a new, larger hash
cluster.
• If your application often performs full table scans and you must allocate a great deal of
space to the hash cluster in anticipation of the table growing.
Hash and index clusters require a lot of planning before being used. There may be more
performance overhead involved for major operations like bulk (direct path) inserts and
rebuilds.

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/594655/viewspace-973783/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 开博啦
下一篇: 关于索引
请登录后发表评论 登录
全部评论
  • 博文量
    5
  • 访问量
    4613