zoukankan      html  css  js  c++  java
  • cluster

     

    Non-clustered

    The data is present in random order, but the logical ordering is specified by the index. The data rows may be randomly spread throughout the table. The non-clustered index tree contains the index keys in sorted order, with the leaf level of the index containing the pointer to the page and the row number in the data page. In non-clustered index:

    • The physical order of the rows is not the same as the index order.
    • Typically created on column used in JOIN, WHERE, and ORDER BY clauses.
    • Good for tables whose values may be modified frequently.

    Microsoft SQL Server creates non-clustered indexes by default when CREATE INDEX command is given. There can be more than one non-clustered index on a database table. There can be as many as 249 nonclustered indexes per table in SQL Server 2005 and 999 nonclustered indexes per table in SQL Server 2008. It also creates a clustered index on a primary key by default.[1]

    Clustered

    Clustering alters the data block into a certain distinct order to match the index, resulting in the row data being stored in order. Therefore, only one clustered index can be created on a given database table. Clustered indices can greatly increase overall speed of retrieval, but usually only where the data is accessed sequentially in the same or reverse order of the clustered index, or when a range of items is selected.

    Since the physical records are in this sort order on disk, the next row item in the sequence is immediately before or after the last one, and so fewer data block reads are required. The primary feature of a clustered index is therefore the ordering of the physical data rows in accordance with the index blocks that point to them. Some databases separate the data and index blocks into separate files, others put two completely different data blocks within the same physical file(s). Create an object where the physical order of rows is same as the index order of the rows and the bottom(leaf) level of clustered index contains the actual data rows.

    They are known as "index organized tables" under Oracle database.

    Cluster (Oracle)

    In Oracle database, multiple tables can be joined into a cluster (not to be confused with clustered index described above). The records for the tables sharing the value of a cluster key shall be stored together in the same or nearby data blocks. This may improve the joins of these tables on the cluster key, since the matching records are stored together and less I/O is required to locate them.[2] The data layout in the tables which are parts of the cluster is defined by the cluster configuration. A cluster can be keyed with a B-Tree index or a hash table. The data block in which the table record will be stored is defined by the value of the cluster key.

  • 相关阅读:
    FreeRTOS移植到Cortex-M3-M4
    码位颠倒C程序
    开平方与魔数0x5F3759DF:Quake III 开源代码
    MathJax: Web 页面显示数学公式
    Notepad++ NppExport: 让你在Microsoft word 中粘贴语法高亮代码
    [转]matlab 函数三种定义方式
    机器上的几种Eclipse
    自己开发CC3000模块
    Java中的线程的生命周期大体可分为5种状态
    srand和rand的用法和联系
  • 原文地址:https://www.cnblogs.com/silva/p/2315059.html
Copyright © 2011-2022 走看看