Re: oracle - mysql comparison
"VC" <boston103@hotm ail.com> wrote in message
news:SgrLc.1542 60$XM6.64529@at tbi_s53...[color=blue]
>
> "Daniel Morgan" <damorgan@x.was hington.edu> wrote in message
> news:1090378179 .508307@yasure. ..[color=green]
> > VC wrote:[color=darkred]
> > > As I've demonstrated, only a subset of rows involved in the[/color][/color][/color]
transaction[color=blue]
> has[color=green][color=darkred]
> > > to be locked which naturally can be the whole table.[/color]
> >
> > Patently false. You can not lock rows that have not yet been inserted
> > while the transaction is taking place.[/color]
>
> As a matter of fact, you can. In the reservation example:
>
> create table PASSENGERS(FLIG HT_NUMBER ..., INFO ...);
> create index P_Idx on PASSENGERS(FLIG HT_NUMBER);
> set transaction isolation level serializable
>
> ... the statement below will lock not only the existing rows satisfying[/color]
the[color=blue]
> FLIGHT_NUMBER=9 99 predicate, but also the relevant index (P_Idx) range[/color]
thus[color=blue]
> preventiing potential *inserts*:
>
> select count(*) into l_cnt from PASSENGERS where FLIGHT_NUMBER=9 99; --
>
> This mechanism is called key-range locking. It allows to avoid full table
> locks and is implemented in all the major locking databases. MYSQL, by[/color]
the[color=blue]
> way, has it too.
>[color=green]
> >And you have no means of keeping
> > them out of your result set except a full table lock.[/color]
>
> See above.
>
> VC
>
>[/color]
And if it is a page locking database then it will lock whole pages of
indexes (as the index is traversed) witch will effectively lock the entire
table (or about 95% of it)
Jim
"VC" <boston103@hotm ail.com> wrote in message
news:SgrLc.1542 60$XM6.64529@at tbi_s53...[color=blue]
>
> "Daniel Morgan" <damorgan@x.was hington.edu> wrote in message
> news:1090378179 .508307@yasure. ..[color=green]
> > VC wrote:[color=darkred]
> > > As I've demonstrated, only a subset of rows involved in the[/color][/color][/color]
transaction[color=blue]
> has[color=green][color=darkred]
> > > to be locked which naturally can be the whole table.[/color]
> >
> > Patently false. You can not lock rows that have not yet been inserted
> > while the transaction is taking place.[/color]
>
> As a matter of fact, you can. In the reservation example:
>
> create table PASSENGERS(FLIG HT_NUMBER ..., INFO ...);
> create index P_Idx on PASSENGERS(FLIG HT_NUMBER);
> set transaction isolation level serializable
>
> ... the statement below will lock not only the existing rows satisfying[/color]
the[color=blue]
> FLIGHT_NUMBER=9 99 predicate, but also the relevant index (P_Idx) range[/color]
thus[color=blue]
> preventiing potential *inserts*:
>
> select count(*) into l_cnt from PASSENGERS where FLIGHT_NUMBER=9 99; --
>
> This mechanism is called key-range locking. It allows to avoid full table
> locks and is implemented in all the major locking databases. MYSQL, by[/color]
the[color=blue]
> way, has it too.
>[color=green]
> >And you have no means of keeping
> > them out of your result set except a full table lock.[/color]
>
> See above.
>
> VC
>
>[/color]
And if it is a page locking database then it will lock whole pages of
indexes (as the index is traversed) witch will effectively lock the entire
table (or about 95% of it)
Jim
Comment