Re: isolation level RR
Posted in 1997
Katarina Hamzova wrote:
> How does isolation level repeatable read work
> I thought it places share locks on every row
> selected in queries in transaction -
> i did this:
> begin work;
> set isolation to repeatable read
> select * from table where ...> ...
> i expected it places locks
> on rows according to where clause.
> But it placed share lock on table .
> Am i missing something ?
Up to a point, a query operating under repeatable read places a shared
lock on every row in encounters while trying to locate rows that fit the
query. As I have understood it, if the optimizer guesses it will looking
at some number of rows - i.e. will place more than than some large
number of locks (or a percentage?) - it gives up on this scheme and just
places a shared lock on the whole table. The reasoning behind this
makes sense (albeit arguable) but I can't go into it here.
I hope that explains the mystery.
--
-- Jake (Never yelled "CROWDED THEATER!" during a fire)
+------------------------------------------------------------+
| The expedient performance of a task with excessive concern |
| regarding its duration-to-completion engenders a virtual |
| certainty of diminished benefit therefrom. |
| -- Benjamin Franklin (but he said it in 3 words) |
+------------------------------------------------------------+