Index or Not Index
来源:互联网 发布:淘宝客服回复客人技巧 编辑:程序博客网 时间:2024/05/21 10:24
适合建索引的情况
* 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.
* 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).
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.
参考
Index the Correct Tables and Columns
- Index or Not Index
- Index
- Index
- index
- index
- index
- index
- index
- Index
- index
- index
- index()
- Index
- index
- INDEX
- index
- index
- Index
- 谁是你的潜在朋友
- Linux 脚本编写基础
- [转]acedSSGet()函数用法详解
- Socket/TCP粘包、多包和少包, 断包
- 799-兰州烧饼
- Index or Not Index
- 基于visual Studio2013解决C语言竞赛题之0710排序函数
- c_打印星型
- python 列表操作总结
- Linux 下MYSql 的一些配置
- 延时跳转的几种方式
- openfire 源代码搭建 开发环境(一)
- c语言中关于指针的一些乱七八糟的代码 VC6中直接编译运行!
- 多可科成绩单