这样的SQL 还能优化吗?
SELECT *
FROM (SELECT A.*, ROWNUM RN
FROM (select *
from v_ywb_sqxx a
where a.ywbh in (select ywbh
from G14_xx b
where b.org = 'BDI'
and b.qfrq = '201301'
and b.t_bs = '1')) A
WHERE ROWNUM <= 30)
WHERE RN >= 1
G14_xx 没有索引 v_ywb_sqxx 是个试图,每个表有索引
------解决方案--------------------执行计划、发出来
------解决方案--------------------用explain plan for的方式。
------解决方案--------------------最外层没啥意义吧?试一试去掉:
SELECT A.*, ROWNUM RN
FROM (select *
from v_ywb_sqxx a
where a.ywbh in (select ywbh
from G14_xx b
where b.org = 'BDI'