在oracle 中创建cluster 可以加快查询速度
当insert时,update、delete时有什么影响?
还有其他的使用时机吗?可以随便使用吗?

解决方案 »

  1.   

    CLUSTER适用于OLAP系统对其进行DML操作时可能效果上会有一些欠缺 
      

  2.   

    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96524/c11schem.htm#25479点进上面的链接
    最前面的目录里找到cluster点击查看详细内容benefits
    Disk I/O is reduced for joins of clustered tables. 
    Access time improves for joins of clustered tables. 
    In a cluster, a cluster key value is the value of the cluster key columns for a particular row. Each cluster key value is stored only once each in the cluster and the cluster index, no matter how many rows of different tables contain the value. Therefore, less storage is required to store related table and index data in a cluster than is necessary in nonclustered table format. 
      

  3.   

    如果是index cluster,则需要在列上建索引,有索引,dml时肯定会有影响了。
    hash cluster 应该在insert的时候会通过hash key,应该也有一个计算的过程吧?
    这种为了加快查询而牺牲DML,应该是大表才用的。
      

  4.   


    我目前的情况是。我需要3张表做联合查询。每张表的数据都300W以上。三张表的数据行是相等的。这三张表都会有新的数据插入进来。
    当做表连接查询时,是比较慢的。所以考虑使用cluster
    我定义的cluster是默认的也就是index cluster.
    请问我这种需求适合这样操作吗?有没有更优的方法?
      

  5.   

    看你在这3张表上哪个需求更重要了,dml频繁的表,尽量少建索引。如果查询要求第一,那就牺牲DML性能吧。具体还是得看业务需求更注重哪个。
    另外如果是每月都300w可以考虑分区表了。300w3表联查,如果是查统计信息,可以考虑下物化视图,如果是查详细信息,则尽量在现有基础上根据执行计划优化sql吧
      

  6.   

    在使用分区表的时候,对insert 有什么影响没有?还有,我把三张表都按DATE范围分区。同一时间段的放在一个分区里。这样可以吗?在DATE上创建索引,是全局还是局部好一些呢?