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);
解决方案 »
- 用sqlldr把本地的txt文件导入到有主键的表怎么做?????
- ORACLE在Windows运行的企业有那些,多吗:
- oracle并行处理的问题???
- 急!!!!mview 取另一个数据库的数据
- 用一条sql能否实现?
- 求助,关于oracle表分区的问题。
- 求助:ora-922错误,缺少或无效选项,与NOCOMPRESS有关
- 请教判断是否有记录的最佳SQL语句
- ACCESS通过ODBC访问数据库有的记录能修改有的记录不能修改???
- what're the frequently used packages and data dictionaries.
- 请帮忙解释下这个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
/