A reader, June 13, 2020 - 2:04 pm UTC
thanks Connor for quick response.
I have question about UNDO reading, Assume I fired a query which need to read 100 blocks (1 .. 100). After reading 10 blocks (1st to 10th), there is DML updated 1st block, in this case, does my query check the 1st block again? if unread block, eg. 20th block was updated/inserted multiple time (let's say 3 times), does oracle only read latest block in UNDO, or oracle will read same block 3 times in UNDO?
June 15, 2020 - 3:20 am UTC
Lets say we need to read blocks 1 to 10. Each block has a system change number on it (think of it like a "last changed" timestamp).
I start my query at 9am and lets say each block takes 10mins to read :-)
So i need every block that I read to be in a state as it was at 9am.
at 9am, Read block 1, its last change is 8:46am => perfect, I can use it
at 910am, Read block 2, its last change 9:03am => dang it, I need to roll it back to 9am or before, then I can use it
at 920am, Read block 3, its last change 9:07am => dang it, I need to roll it back to 9am or before, then I can use it
etc etc
So I only need to read each block once, but each block might have a diferent of undo to rewind.
And of course, I'm using time as a metaphor but thats not exactly correct. Block 2 might be last change 9:03 but that might be the last of 10,000 changes between 9am and 903. Whereas block 3 might have 2 changes, the last one being at 907.
So in this case, block 2 will be way more expensive to unravel.
But we don't need to go back and revisit blocks (in this instance)