[Info-ingres] concepts

mike_cu80 at yahoo.com mike_cu80 at yahoo.com
Sun Mar 8 15:33:43 UTC 2015


How is a select query performed? Are the rows locked and read in a linear incremental fashion?
For example,assuming row level locking, is row 1 locked and read, then is row 2  locked and read and so on ?

Let's say transaction T1 wants to select 10 rows, under the linear/incremental scenario,is it possible for another transaction T2 to get a lock on say row 8 before T1 gets to it? 

If T1 wants to update the rows, and under this same scenario T2 gets to and updates row 8 before T1 does, would be wiser to first select all rows while putting a shared lock on them, and do the update as a second step so that scenario cannot occur ?(for a dbms that does not support Select for Update) Is that exact scenario what Select for Update is used for?

Also what happens with the select component of an update statement?
Is a select first done and then a update for each row? or are all the selects done reading and then a batch of updates occur?

And is the isolation level having an effect on the select component of an update statement?




More information about the Info-ingres mailing list