Oracle常用提示
取前N条分页数据提示
采用row_number进行高效分页
参考:http://www.oracle.com/technetwork/issue-archive/2007/07-jan/o17asktom-093877.html
示例1
2
3
4
5
6
7
8
9select *
from (
select /*+ first_rows(25) */
your_columns,
row_number()
over (order by something unique)rn
from your_tables )
where rn between :n and :m
order by rn;
结果集缓存提示
用于缓存长期稳定的小表数据
参考:http://www.oracle.com/technetwork/articles/sql/11g-caching-pooling-088320.html
示例1
SELECT /*+ result_cache */ * FROM Your_Tables;