0
我選擇這樣的:如何選擇10排不完整掃描
select * from
(select aa.*,rownum as rn
from (select someRows
from (select *
from table a
left outer join mySecTable b)
left outer join otherTable c
where conditions) aa
order by aa.myColumn) ff
where ff.rn >=30 and rn<40
我想不完全掃描來選擇排序的數據的10個列,但這種選擇是怎麼回事全掃描和不管它是什麼將在最後的條件將有ff.rn >=30 and rn<40
或什麼都沒有選擇的時間是一樣的。
我的主要選擇是
select * from
(select someRows
from
(select *
from myTable a
left outer join mySecTable b
) left outer join otherTable c
where conditions
比我想訂這種選擇,並採取10行。我怎樣才能做到這一點沒有全面掃描?
您的目標不應該是消除完整掃描,而應該是儘可能執行查詢 - 可能是最好的可能的方式是使用全面掃描。僅僅從查看查詢就不可能說,但如果有'myColumn'上的索引,優化器*可能會使用該索引來避免全面掃描 - 但它很可能不會。 –