ITPub博客

首页 > 数据库 > Oracle > Index or Not Index

Index or Not Index

原创 Oracle 作者:pan_tian 时间:2014-07-03 11:55:18 0 删除 编辑
适合建索引的情况
* The column is queried frequently.

* A referential integrity constraint exists on the column.

* A UNIQUE key integrity constraint exists on the column.

*  Create an index if you frequently want to retrieve less than 15% of the rows in a large table.

* To improve performance on joins of multiple tables, index columns used for joins.
Primary and unique keys automatically have indexes, but you might want to create an index on a foreign key.

* There is a wide range of values (good for regular indexes).

* There is a small range of values (good for bitmap indexes).

* The column contains many nulls, but queries often select all rows having a value. 
   In this case, use the following phrase:
   WHERE COL_X > -9.99 * power(10,125)
   Using the preceding phrase is preferable to:
   WHERE COL_X IS NOT NULL
   This is because the first uses an index on COL_X (assuming that COL_X is a numeric column).

不适合建索引的情况
* Small tables do not require indexes. 

* There are many nulls in the column and you do not search on the not null values.

参考


<!-- Baidu Button BEGIN -->

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

上一篇: Why NOT Use My Index
下一篇: How to check others Concurrent Request Output
请登录后发表评论 登录
全部评论
暂无介绍

注册时间:2012-02-18

最新文章