ITPub博客

首页 > 数据库 > 数据库开发技术 > Sorted Hash Cluster

Sorted Hash Cluster

原创 数据库开发技术 作者:shiyihai 时间:2007-08-07 15:49:20 0 删除 编辑

When the Oracle database stores data in a heap-organized table, the rows are not stored in a usercontrolled order. Rather, the decision about where to place a row is dependent on storage heuristics. The Oracle database does not guarantee the return order of the rows unless the query
includes an ORDER BY clause.

[@more@]Inside a sorted hash cluster, the rows are organized in lists of sorted rows. Each list corresponds to a particular value of the hash key columns defined by the corresponding sorted hash cluster. Within each list, the rows are stored in the order specified by the sort key columns defined by the corresponding sorted hash cluster. This is also the default return order when querying the table by using the hash key columns in the predicate.
Sorted hash clusters offer the benefit of eliminating the CPU time and private memory needed to sort the data for queries that require a guaranteed returned order between SQL statements. When querying data in a sorted hash–clustered table by cluster key columns with an ORDER BY
clause that references only the sort key columns or one of their prefixes, the optimizer avoids the sorting overhead, because the rows are returned sorted by the sort key columns. However, for the same kind of queries, if you have an ORDER BY clause on a suffix of the sort key columns or nonsort key columns, additional sorting is required, assuming that no indexes are defined on the table. For this reason, when you create a sorted hash cluster, select its order key columns carefully.

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

请登录后发表评论 登录
全部评论
  • 博文量
    235
  • 访问量
    1707884