do not build indexes unless necessary. 索引是非常占资源的
To maintain optimal performance, drop indexes that an application is not using. 不用的索引可以drop掉, 通过toad可以生成监控脚本, 监控一段时间内, 哪些脚本没有被使用 (ALTER INDEX MONITORING USAGE)
什么时候创建索引
Consider indexing keys that appear frequently in WHERE clauses.
Consider indexing keys that frequently join tables in SQL statements. For more information on optimizing joins.
Choose index keys that have high selectivity. The selectivity of an index is the percentage of rows in a table having the same value for the indexed key. An index's selectivity is optimal if few rows have the same value.'
当然, 如果你的索引列上的值, 99%都一样, 那么恐怕就没有必要在这个列上建立索引了.
Do not use standard B-tree indexes on keys or expressions with few distinct values.
Do not index frequently modified columns.
Do not index keys that appear only in WHERE clauses with functions or operators.
要给外键建立索引 (大师有提过)
When choosing to index a key, consider whether the performance gain for queries is worth the performance loss for INSERTs, UPDATEs, and DELETEs and the use of the space required to store the index.

组合索引
CREATE INDEX comp_ind ON table1(x, y, z);
那么, 可以走索引的方式是: x, xy, and xyz combinations of columns are leading portions of the index

你想避免使用索引时: 比如, 你知道 full table scan 效率更高时:
Use the NO_INDEX hint to give the query optimizer maximum flexibility while disallowing the use of a certain index.
Use the FULL hint to instruct the optimizer to choose a full table scan instead of an index scan.
Use the INDEX or INDEX_COMBINE hints to instruct the optimizer to use one index or a set of listed indexes instead of another.

重建索引
Usually, ALTER INDEX ... REBUILD is faster than dropping and re-creating an index,

Function 索引
CREATE INDEX uppercase_idx ON employees (UPPER(last_name));
SELECT * FROM employees WHERE UPPER(last_name) = 'MARKSON';

Partitioned Indexes
类似 partitioned table
Oracle Database supports both range and hash partitioned global indexes. In a range partitioned global index, each index partition contains values defined by a partition bound.
In a hash partitioned global index, each partition contains values determined by the Oracle Database hash function.

14 Using Indexes and Clusters的更多相关文章

  1. PLSQL_性能优化系列08_Oracle Insert / Direct Insert性能优化

    2014-09-25 Created By BaoXinjian

  2. 訪问远程WAMP 下phpmyadmin

    WAMP环境是一个非常优秀的webservice集成环境,它集成的phpmyadmin也是一款非常优秀的数据库訪问软件.wamp默认安装下,phpmyadmin工具仅仅能本地用,在站点开发中,数据库都 ...

  3. Oracle组成介绍

    Oracle Database 11g是一些特殊文件的集合,这些文件是用数据库配置助手创建的,然后用OEM Grid Control完成相关工作.这些数据库文件是通过一组共享内存进程来进行访问的,这组 ...

  4. oracle之表空间(tablespace)、方案(schema)、段(segment)、区(extent)、块(block)

    数据文件和日志文件是数据库中最关键的文件.它们是数据存储的地方.每一个数据库至少有一个与之相关的数据文件,通常情况下不仅仅一个,有非常多.数据在数据文件里是怎样组织的?要了解这些内容我们首先必须理解什 ...

  5. schema in oracle

    the conception of schema is different in different db software. here i just refer to oracle schema. ...

  6. 关于在windows server 2008 上部署wampserver2.5部署的问题

    1.关闭windows自带防火墙 2.httpd.conf文件权限 apache 2.4.9 外网访问的问题参考此文: http://blog.csdn.net/lysc_forever/articl ...

  7. [Java]数据分析--聚类

    距离度量 需求:计算两点间的欧几里得距离.曼哈顿距离.切比雪夫距离.堪培拉距离 实现:利用commons.math3库相应函数 1 import org.apache.commons.math3.ml ...

  8. 14.8.9 Clustered and Secondary Indexes

    14.8.9 Clustered and Secondary Indexes 每个InnoDB 表有一个特殊的索引称为 clustered index 用于存储数据. 通常, clustered in ...

  9. 14.2.5.6 Adaptive Hash Indexes 自适应Hash Indexes

    14.2.5.6 Adaptive Hash Indexes 自适应Hash Indexes adaptive hash index(AHI) 让InnoDB 执行更加像在一个内存数据库里在, 在不牺 ...

随机推荐

  1. 对于改善 MySQL 数据装载操作有效率的方法是怎样

    多时候关心的是优化SELECT 查询,因为它们是最常用的查询,而且确定怎样优化它们并不总是直截了当.相对来说,将数据装入数据库是直截了当的.然而,也存在可用来改善数据装载操作效率的策略,其基本原理如下 ...

  2. bianwu 哈希表输出到 excel

    一.输出到excel 函数: protected void InputFileTheme(object[] Header,object [] DataFileds,string sql,string ...

  3. The trouble of Xiaoqian

    The trouble of Xiaoqian Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Oth ...

  4. 使用label在winfrom中添加分割线

    1.水平分隔线:GroupBox2. 水平,垂直分隔: Lable (AutoSize = false, BorderStyle= Fixed3D , 还要调整Size的大小 水平调整Height = ...

  5. python-haproxy作业讲解视频总结

    刚看完瞎驴的haproxy配置文件的作业讲解视频: 总结: 1.用户输入的字符串数据类型转换其他数据类型 1.1 eval('用户输入的数据') 1.2 json.loads('用户输入的数据') 2 ...

  6. 附加数据库对于服务器失败(Microsoft.SqlServer.Smo),无法升级数据库,因为它是只读的,或者具有只读文件

    今天在将一个 SQL Server 2000 数据库附加到 SQL Server 2005时出现如下的错误:附加数据库对于服务器失败(Microsoft.SqlServer.Smo),无法升级数据库t ...

  7. range函数

    th> a=torch.range(,) [.0001s] th> a [torch.DoubleTensor of size ] [.0002s] th> a=torch.rang ...

  8. 2016年11月11日 星期五 --出埃及记 Exodus 20:2

    2016年11月11日 星期五 --出埃及记 Exodus 20:2 "I am the LORD your God, who brought you out of Egypt, out o ...

  9. C#中另类自定义公式计算 字符串转换为计算公式,并得出计算结果

    [csharp] view plain copy print? //方法一 利用DataTable中的Compute方法 例如:1*2-(4/1)+2*4=6 , , , ); DataTable d ...

  10. C#json 解析

    Json样例一: string jsonText= {Code)\/)\/"}}} JObject jo = JObject.Parse(jsonText); string strCode= ...