有两张表 table1, table2。
这两张表中都有ID 字段,其中 ID 是varchar2(20)。
table2 已经对ID作索引了。现在有一SQL语句:
select * 
from table1 a
left join table2 b
on a.id = b.id
where b.id is not null我发现它的执行计划根本就没有用到索引。
table2 表仍然是full scan, 导致速度很慢。
我感觉很奇怪, 请问大侠怎么回事?