low performance using oracle paging in resultset
i got 20 million data in my table, and i have two different paging sql to
use;
1.SELECT * FROM ( SELECT row_.*, rownum rownum_ FROM (select * from
TB_CHSS_GRJKDA order by GRDAID) row_ ) WHERE rownum_ <= 1000000 AND
rownum_ >= 900000
2.SELECT t_table.* FROM TB_CHSS_GRJKDA t_table WHERE ROWID IN ( SELECT
r_id FROM ( SELECT r_id, rownum rn FROM ( SELECT ROWID r_id FROM
TB_CHSS_GRJKDA t_table order by t_table.GRDAID ASC) WHERE rownum <=
10001000) WHERE rn >= 10001000)
the question is,with sql 1, it took me at least 1 hour to fetch the
result, after the limit was increasing to million level,but once its done,
its pretty with resultset.next(),the network io can reach 10m/s. when
changed to sql 2, it only took 10s to fetch the result,but in the
result.next(), the network io can only reach to 500k/s.
can you be so kind to explain me this wrap?
No comments:
Post a Comment