in 是不会使用索引的。
可以用
exists代替。
select *
from b
where exists (
select a2 from a where a1 =89 and a.a2=b.b2);
可以用
exists代替。
select *
from b
where exists (
select a2 from a where a1 =89 and a.a2=b.b2);
解决方案 »
- exp imp oracle导出/导入问题
- oracle备份文件超过4G如何进行备份(高分求教)
- 续上贴:如何从表中找出编码重复而名称不重复的所有记录?请高手对我的两种查询方案的跟踪结果进行分析?
- 请教一个sql语句
- 怎样绕过sysdba密码?
- 关于视图的update问题!
- ORACLE难题(在线等待)
- 安装时出现ora-12203:TNS:无法与目标连接,要求输入口令,怎么回事?????
- 能否象sql server2000企业管理器那样在画面中加上对所建表字段的注释?
- 大家帮帮忙,下面的sql还能怎么优化,现在执行它一共才400多条纪录得花费近一分钟的时间!
- 请帮忙解释下这个sql语句 (rank,partition)
- 为什么不能安装ORACLE
SQL> SET AUTOTRACE ON
SQL> SELECT * FROM FND_USER A WHERE A.USER_ID IN (1,2);
.....
Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=2 Bytes=412)
1 0 INLIST ITERATOR
2 1 TABLE ACCESS (BY INDEX ROWID) OF 'FND_USER' (Cost=2 Card
=2 Bytes=412) 3 2 INDEX (RANGE SCAN) OF 'FND_USER_U1' (UNIQUE) (Cost=1 C
ard=2)Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
5 consistent gets
2 physical reads
0 redo size
1475 bytes sent via SQL*Net to client
309 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
2 rows processed一个表上有索引,如果你用索引的话,不管有多少条的数据,系统都会使用索引,当然,如果表的记录不是很多的话,建议在关联的时候不要使用小表的索引.
analyze table a1 compute statistics
for table
for all indexed columns
for all indexes
/