JAVA分页查询:最后一页显示极其缓慢,是倒数第二页执行效率的10分之一,请高人解决

连接池采用的是DBCP。
在JAVA应用中做分页查询时,进行到最后一页时用时大概20秒左右,其他页只有0.3秒左右,下面附上语句,请高人帮忙看看是什么问题?

select uidused,pid,ekuid,s1sid,flag from(select rownum rnm ,a.* from(select * from tab_test
where 1=1 and flag!=5 and systemtime>=to_date('2008-3-11 11:8:15','yyyy-mm-dd hh24:mi:ss') and systemtime<=to_date('2008-6-11 11:8:15','yyyy-mm-dd hh24:mi:ss') order by uidused desc) a where rownum <=29010 )where rnm>=28996//该语句是执行查询最后一页时打印出的SQL语句。

下面是执行倒数第二页时的查询语句:
select uidused,pid,ekuid,s1sid,flag from(select rownum rnm ,a.* from(select * from tab_test
where 1=1 and flag!=5 and systemtime>=to_date('2008-3-11 11:8:15','yyyy-mm-dd hh24:mi:ss') and systemtime<=to_date('2008-6-11 11:8:15','yyyy-mm-dd hh24:mi:ss') order by uidused desc) a where rownum <=28995 )where rnm=>28981


附录:每页15条数据,数据库中共有45万条数据。表tab_test的主键为UIDUSED,在PID上也建有索引。只有执行最后一页查询时才比较缓慢,其他页查询非常快,请高手不吝赐教

另外附上在CSDN讨论得帖子地址:http://topic.csdn.net/u/20080611/15/7c411d94-d3fc-4fc3-af9e-0f8eab5b8a77.html