使用remove_constants工具查看Oracle是否使用绑定变量
这个也是Tom大神写的工具。https://asktom.oracle.com/pls/asktom/f?p=100:11:::::P11_QUESTION_ID:1163635055580下面模拟没有绑定变量的环境,然后使用该工具查看创建实验帐号conn / as sysdbacreate user edmond identified by edmond;grant connect,resource,dba to edmond;create table t(x int);insert into ...
SQL优化实例
示例一:hint滥用select /*+ ordered use_nl(b a c d)*/ * from b,a,c,d where b.col1 = a.col1 and a.col2 = c.col2 and a.col3 = d.col3 and a.dt >= to_date('20010101 00:00:00','YYYYMMDD HH24:MI:SS') &nbs...
有索引却走全表扫描的实验分析
最近在查询某范围的数据时,返回结果仅占整个表数据的0.05%,在相应字段上有对应索引,然而这部分数据并没有走索引,将根据如下实验证明此种情况的原因一 构建环境1建立测试表 有两个字段,主键ID和手机号,手机号上有B树索引drop table TEST_HIS-- Create tablecreate table TEST_HIS( id &nbs...