浏览 1804 次
锁定老帖子 主题:oracle 分页笔记
该帖已经被评为新手帖
|
|
---|---|
作者 | 正文 |
发表时间:2008-09-02
-- 注: export_book 表中有21000万条数据。 -- 以下是我的oracle 分页验证 ,查询速度应该是很快了 。 主要是因为建索引的缘故 --。如果没有索引,数据将变的很慢。越往后查越费时间,多建索引就行了 select * from ( select a.* , rownum rownum_ from ( select * from export_book ) a ) b where b.rownum_ >=10 and b.rownum_ <= 20 --耗时 0.922 秒 select * from ( select a.* , rownum rownum_ from ( select * from export_book ) a ) b where b.rownum_ >=10000 and b.rownum_ <= 10010 --耗时 0.844 秒 select * from ( select a.* , rownum rownum_ from ( select * from export_book ) a ) b where b.rownum_ >=20000 and b.rownum_ <= 20010 --耗时 0.89 秒 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2009-05-19
怎么建得索引呢?分享一下办法啊...
|
|
返回顶楼 | |
发表时间:2009-05-19
多建索引不一定是好事.
索引有分类,不同的索引的建立对操作数据会有影响. 体现在于增加和删除数据,如果索引太多,增删效率会很低的,lz可能进行测试和google下. |
|
返回顶楼 | |