select y.f ybm y.a h, y.w SLB, y.w SNR, y.j arq, y.R OWNO
The from (select t.f ybm, t.a h, t.w SLB, t.w SNR, t.j arq, rownum ROWNO
The from (select fybm, ah, WSLB WSNR, jarq from flws_1 order by id) y, t)
Where y.R OWNO between 0 and 1000;
FLWS this table data in more than 12 w, the card will be more and more long, then the table size is about 500 m, about 3 seconds
When the data up to 14 w, card time into 170 ~ 180 seconds when the table size is about 552 m
Actual demand 750 w + volume of data, because the data are not exposed to so its own data simulation to 200 w, 1000 results, return after 1000
Queries can't normal end,
Whether using Java JDBC or PL/SQL client interface, will card in the final, the previous data has been returned to
Excuse me what reason be?
Using the second paging efficiency were similar, but not stuck
select y.f ybm y.a h, y.w SLB, y.w SNR, y.j arq, y.R OWNO
The from (select t.f ybm, t.a h, t.w SLB, t.w SNR, t.j arq, rownum ROWNO
The from (select fybm, ah, WSLB WSNR, jarq from FLWS order by id) t where rownum & lt; Y=1000)
Where y.R OWNO & gt;=1;
The second method does not need to discuss, here I just want to know, the traditional paging exactly what causes will return to the last caton?
Under the great god please help analysis
CodePudding user response:
Top a , problem although numerous, still hope to understand the principleCodePudding user response:
- use row_number function
Select *
The from (select fybm, ah, WSLB WSNR, jar, row_number () over (order by id) rn
The from flws_1)
Where an rn between 1 and 2000
CodePudding user response: