-- 注: 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 秒
-- 以下是我的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 秒