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. listview实现点击条目上的箭头展开隐藏菜单。

    效果如下图,当点击listview中的小三角时,显示出下面布局,再点隐藏, 点击其他条目的三角时,上一个展开的条目隐藏的同时展开当前条目. 思路是在item布局中放入展开菜单的布局,并设置状态为隐藏, ...

  2. load-on-startup

    在servlet的配置当中,<load-on-startup>1</load-on-startup>,一般出现在启动线程的servlet当中 含义是: 标记容器是否在启动的时候 ...

  3. PHP之验证码类

    <?php /** * Created by PhpStorm. * User: Administrator * Date: 2016/6/20 * Time: 14:29 */ Class c ...

  4. R2D2 and Droid Army(多棵线段树)

    R2D2 and Droid Army time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  5. Train Problem I 分类: HDU 2015-06-26 11:27 10人阅读 评论(0) 收藏

    Train Problem I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) ...

  6. 对于数据包的截取,使用linux中的netfilter钩子函数

    http://blog.csdn.net/wswifth/article/details/5115358 在师哥的代码(packet.c)中使用的是Linux2.4内核中的一个子系统:netfilte ...

  7. linux里用cmake安装的软件要怎么卸载?

    找到make install之后产生的这个文件install_manifest.txt 这里在build文件里面有一个 install_manifest.txt,在里面有安装的所有东西的路径,删除它们 ...

  8. PLsql设置

    1.类SQL PLUS窗口:File->New->Command Window,这个类似于oracle的客户端工具sql plus,但比它好用多了. 2.设置关键字自动大写:Tools-& ...

  9. html 标签学习

    form 属性 定义和用法 enctype 属性规定在发送到服务器之前应该如何对表单数据进行编码. 默认地,表单数据会编码为 "application/x-www-form-urlencod ...

  10. ubuntu配置服务器环境

    今天环境不知道怎么就不能用了.自己新配了一个: 添加源: vi /etc/apt/sources.list 将下面这些源添加进去: deb http://debian.ustc.edu.cn/ubun ...