我在学习sql_trace时用
select * from 条码详细 where 条码id<>439434
和
select * from 条码详细 where 条码id<>‘439434’
这两句话作比较,因为我在条码id(数值型)上加了索引,所以我预计<>439434 会快一些。可是跟踪的结果是相同的为什么呢?(问1)
********************************************************************************
select *
from
条码详细 where 条码id<>439434 call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 3288 0.00 0.00 0 5289 5 210381
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3290 0.00 0.00 0 5289 5 210381Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 43 Rows Row Source Operation
------- ---------------------------------------------------
210381 TABLE ACCESS FULL条码详细Rows Row Source Operation
------- ---------------------------------------------------
210381 TABLE ACCESS FULL条码详细
并且都进行了全表访问?(问2)
Misses in library cache during parse: 1
这句话是什么含义?(问3)
select * from 条码详细 where 条码id<>439434
和
select * from 条码详细 where 条码id<>‘439434’
这两句话作比较,因为我在条码id(数值型)上加了索引,所以我预计<>439434 会快一些。可是跟踪的结果是相同的为什么呢?(问1)
********************************************************************************
select *
from
条码详细 where 条码id<>439434 call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 3288 0.00 0.00 0 5289 5 210381
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3290 0.00 0.00 0 5289 5 210381Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 43 Rows Row Source Operation
------- ---------------------------------------------------
210381 TABLE ACCESS FULL条码详细Rows Row Source Operation
------- ---------------------------------------------------
210381 TABLE ACCESS FULL条码详细
并且都进行了全表访问?(问2)
Misses in library cache during parse: 1
这句话是什么含义?(问3)
解决方案 »
- SEQUENCE 权限问题?
- ORACLE 10g 逻辑导入(IMPDP)问题
- 登录 pl/sql 就死机
- 有没有图形化的数据挖掘工具用于oracle的
- 已知表里面含有一个“blob”字段,如何把文件放到该字段里面?
- 使用 SQL 如何实现这个问题 分数不够单独加分!
- 有劳朋友,做ORACLE数据库和J2EE 都用到那些开发软件?OS用2000,2000SERVER,还是XP Pro?
- SELECT INTO问题:相同表结构复制出错-----00905: missing keyword (我是新手)
- 如何更改表中列名?
- 刷数据时间计算
- 求救数据库当掉恢复
- oci连接数据库,编译后出现 undefined reference to `OCIInitialize' 是什么意思?哪位高手会?
比如下面sql文我认为第一个更有效率。
select * from table1 where date1='2001/01/23'
select * from table1 where to_char(date1,'yyyy/MM/dd')='2001/01/23'可是用sql_trace跟踪后 效率和分析结果 两句一样???能给个合适的例子吗?
如果仅仅是分析sql语句的优化问题,可以直接在sql plus中set autotrace on或者set autotrace traceonly来查看sql语句的执行计划。