A reader, May 21, 2017 - 4:39 am UTC
Here i confused with one sentence
"Oracle assigns rownum as it processes each row."
Here Processing row means Getting Data From Data base(Physical Memory device) to Cache (SGA or simply RAM) or Displaying Data From Cache(SGA) to Client System?
May 23, 2017 - 1:24 am UTC
As a row is deemed "eligible", ie, it satisfies all the predicates and would be returned to a caller if fetched, it is *then* we assign the rownum.
That is why
select * from table where sal > 0 and rownum = 2
would never return rows, because we would do (conceptually)
row1:
- is sal > 0 ? yes, assign rownum = 1, ie, our first row that meets the criteria
- does it meet "rownum = 2", no, discard
row2:
- is sal > 0 ? yes, assign rownum = 1, ie, our first row that meets the criteria
- does it meet "rownum = 2", no, discard
row3:
- is sal > 0 ? yes, assign rownum = 1, ie, our first row that meets the criteria
- does it meet "rownum = 2", no, discard
etc etc