下载此文档

oraclesql性能优化OracleSQL性能优化.doc


文档分类:通信/电子 | 页数:约10页 举报非法文档有奖
1/10
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/10 下载此文档
文档列表 文档介绍
oracle sql性能优化(Oracle SQL性能优化)
Oracle SQL性能优化
用索引提高效率:
索引是表的一个概念部分,用来提高检索数据的效率,Oracle使用 了一个复杂的自平衡树结构。通常,通过索引查询数据比全表扫描e index. For example: if the only index based on the A and B columns of the table, and there is a record in the A table, B value (123, null), ORACLE will not be accepted with the same A under a B value (123, null) records (insert). However, if the indexed column all is empty, ORACLE will think the key is empty and empty is not empty. So you can insert 1000 records with the same key value, of course they are empty!
Because the null value does not exist in the columns in the index, so the WHERE clause of the index column Performing a null comparison will cause ORACLE to deactivate the index
Inefficient: (index invalid)
SELECT. . . FROM, DEPARTMENT, WHERE, DEPT_CODE, IS, NOT, NULL;
Efficient: (index valid)
SELECT. . . FROM, DEPARTMENT, WHERE, DEPT_CODE, >=0;
always use the first column of the index:
If the index is based on multiple columns, only in the first column of it (leading column) by the where clause references, the optimizer will choose to use the index. This is a simple but very important rule, when only the reference index of second columns, the optimizer uses a full table scan and ignore the index
replace UNION with UNION-ALL (if possible):
When the SQL statement requires UNION two query result set, the two set of results will be merged with

oraclesql性能优化OracleSQL性能优化 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数10
  • 收藏数0 收藏
  • 顶次数0
  • 上传人小健
  • 文件大小87 KB
  • 时间2022-05-20