博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Oracle 作业记录
阅读量:2136 次
发布时间:2019-04-30

本文共 1265 字,大约阅读时间需要 4 分钟。

autotrace

We can observe the execution plan Oracle choses for a given query by using the menu AUTOTRACE

 

LAST_CR_BUFFER_GETS (number of pages from the RAM buffer)       logical reads/consistent gets

LAST_DISK READS (number of pages read from disk)                            physical reads

如果不是第一次执行,LAST_DISK READS会是0,会从cache里面读了

但是这是我们应该避免的,make sure the buffer is empty 

清除缓存命令

ALTER SYSTEM FLUSH SHARED_POOL;ALTER SYSTEM FLUSH BUFFER_CACHE;ALTER SYSTEM FLUSH GLOBAL CONTEXT;

或者重启oracle

 

 

Autotrace and Explain的区别

  • Autotrace runs the query and shows the executed plan and its main statistics
  • Explain shows an estimated best plan and its estimated statistics without running the query

我们将不会使用 Explain Plan

 

 

关于index的clustered和unclustered

By default all indexes in Oracle are unclustered. The only clustered indexes in Oracle are the Index-Organized tables (IOT) primary key indexes.

You can determine if a table is an IOT by looking at the IOT_TYPE column in the ALL_TABLES view

SELECT IOT_TYPE FROM ALL_TABLES WHERE TABLE_NAME='MOVIE4';

 

RULE mode 和 CHOOSE mode

RULE和CHOOSE是两种不同的optimization mode

默认是CHOOSE mode

ALTER SESSION SET OPTIMIZER_MODE=RULE;ALTER SESSION SET OPTIMIZER_MODE=CHOOSE;

 

INDEX RANGE SCAN & INDEX UNIQUE SCAN & FULL SCAN

如果表上有唯一索引, 搜索索引列时会用上INDEX UNIQUE SCAN

 

index range scan是对索引的有序扫描

 

 

 

转载地址:http://goygf.baihongyu.com/

你可能感兴趣的文章
问题:Opencv(3.1.0/3.4)找不到 /opencv2/gpu/gpu.hpp 问题
查看>>
目的:使用CUDA环境变量CUDA_VISIBLE_DEVICES来限定CUDA程序所能使用的GPU设备
查看>>
问题:Mysql中字段类型为text的值, java使用selectByExample查询为null
查看>>
程序员--学习之路--技巧
查看>>
解决问题之 MySQL慢查询日志设置
查看>>
contOS6 部署 lnmp、FTP、composer、ThinkPHP5、docker详细步骤
查看>>
TP5.1模板布局中遇到的坑,配置完不生效解决办法
查看>>
PHPstudy中遇到的坑No input file specified,以及传到linux环境下遇到的坑,模板文件不存在
查看>>
TP5.1事务操作和TP5事务回滚操作多表
查看>>
composer install或composer update 或 composer require phpoffice/phpexcel 失败解决办法
查看>>
TP5.1项目从windows的Apache服务迁移到linux的Nginx服务需要注意几点。
查看>>
win10安装软件 打开时报错 找不到 msvcp120.dll
查看>>
PHPunit+Xdebug代码覆盖率以及遇到的问题汇总
查看>>
PHPUnit安装及使用
查看>>
PHP项目用xhprof性能分析(安装及应用实例)
查看>>
composer安装YII
查看>>
Sublime text3快捷键演示
查看>>
sublime text3 快捷键修改
查看>>
关于PHP几点建议
查看>>
硬盘的接口、协议
查看>>