oracle - mysql comparison

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • VC

    #91
    Re: oracle - mysql comparison


    "Alex Filonov" <afilonov@yahoo .com> wrote in message
    news:336da121.0 407201338.62eab 435@posting.goo gle.com...[color=blue]
    > "VC" <boston103@hotm ail.com> wrote in message[/color]
    news:<p_XKc.135 317$XM6.125873@ attbi_s53>...[color=blue][color=green]
    > > Under DB2/MSSQL, a transaction will lock only a subset of rows (not the
    > > whole table) for a given flight thus ensuring consistent results
    > >[/color]
    >
    > I've said in another post that it's a crappy example. A little bit more on
    > that.[/color]

    You are attacking a strawman -- the design is not what's being discussed
    here, concurrency control/consistency is...

    Here's another simple problem:

    ===
    Let's assume we have two tables, P ( parent) and C (child):

    create table P(pid int primary key, ...);
    create table C(..., pid references P, ...);

    We'd like to insert some child rows but, at the same time, avoid entering
    data in vain if someone happens to delete a parent row during our data
    entry.

    In a locking scheduler, this sequence would run OK:

    select count(*) into l_cnt from P where pid=1;
    if l_cnt > 0 insert into C values(..., 1, ...);
    commit;

    A variation of this scenario might be that, for whatever reason, you cannot
    use referential integrity and cannot delete the parent row. You'd rather
    mark the parent row inactive and prevent insertions if the parent is
    inactive. Our transaction would look:

    select count(*) into l_cnt from P where pid=1 and status='ACTIVE' ;
    if l_cnt > 0 insert into C values(..., 1, ...);
    commit;

    ===

    Needless to say that in the second case Oracle won't ensure the correct
    outcome in any of its isolation levels if a concurrent transaction happens
    to change the parent row status to 'inactive'. In the first case, a
    non-serializable history will be avoided thanks to RI, however, the
    entered data will be lost. The above example can be applied to any similar
    master-detail model.

    An Oracle solution to the problem would be to use the "for update" clause
    instead of just select. This will result in *worse* concurrency under
    Oracle than under a locking scheduler since all inserts will in fact be
    *serial*.

    VC


    Comment

    • Dan

      #92
      Re: oracle - mysql comparison


      "Daniel Morgan" <damorgan@x.was hington.edu> wrote in message
      news:1090378283 .651396@yasure. ..[color=blue]
      > Volker Hetzer wrote:
      >[color=green]
      > > "VC" <boston103@hotm ail.com> schrieb im Newsbeitrag[/color][/color]
      news:RfdLc.1093 72$WX.92600@att bi_s51...[color=blue][color=green]
      > >[color=darkred]
      > >>Here's another textbook example for you:
      > >>==
      > >>There are two linked accounts (id=1 and id=2) in a bank. A transaction
      > >>might look as follows:
      > >>
      > >>== withdraw from 1
      > >>select amount into x from accounts where id=1
      > >>select amount into y from accounts where id=2
      > >>if x+y >= withdrawal then update accounts set amount=amount-withdrawal
      > >>where id=1
      > >>commit
      > >>=====
      > >>
      > >>Any commercial locking scheduler will handle the scenario correctly.[/color][/color][/color]
      Oracle[color=blue][color=green][color=darkred]
      > >>won't.[/color]
      > >
      > > Sorry for butting in but I'm just trying to learn here, so what would go[/color][/color]
      wrong?[color=blue][color=green]
      > > And what about "select for update" in oracle? It's supposed to lock the[/color][/color]
      rows it hits.[color=blue][color=green]
      > >
      > > Lots of Greetings!
      > > Volker[/color]
      >
      > You are correct and VC, as I earlier stated to him, is demonstrating far
      > less than a robust understanding of transaction processing: Lots of
      > smoke but no fire.
      >[/color]

      VC already explained it. Serializable schedules are always preferrable to
      serialized schedules. The 'FOR UPDATE' clause is a hack that only results
      in a *serialized* sequence of transactions.

      Again, you need to understand the difference between serialized and
      serializable, and you need to either take a basic database course or read a
      textbook. All I see from you is a bunch of hand waving. If someone asks a
      question in the middle of some private war of yours, you latch on like the
      guy is backing you up. VC gave more than ample evidence and he was very
      patient in explaining it to you, but you chose to ignore him. Why? Can you
      address issues in a more apolitical manner? Do you always have to have the
      last word, even if it makes you look like a moron?

      The emporer really has no clothes.
      [color=blue]
      > Daniel Morgan
      >[/color]
      - Dan


      Comment

      • Dan

        #93
        Re: oracle - mysql comparison


        "Daniel Morgan" <damorgan@x.was hington.edu> wrote in message
        news:1090378462 .109262@yasure. ..[color=blue]
        > VC wrote:
        >[color=green]
        > > "Alex Filonov" <afilonov@yahoo .com> wrote in message
        > > news:336da121.0 407201338.62eab 435@posting.goo gle.com...
        > >[color=darkred]
        > >>"VC" <boston103@hotm ail.com> wrote in message[/color]
        > >
        > > news:<p_XKc.135 317$XM6.125873@ attbi_s53>...
        > >[color=darkred]
        > >>>Under DB2/MSSQL, a transaction will lock only a subset of rows (not[/color][/color][/color]
        the[color=blue][color=green][color=darkred]
        > >>>whole table) for a given flight thus ensuring consistent results
        > >>>
        > >>
        > >>I've said in another post that it's a crappy example. A little bit more[/color][/color][/color]
        on[color=blue][color=green][color=darkred]
        > >>that.[/color]
        > >
        > >
        > > You are attacking a strawman -- the design is not what's being discussed
        > > here, concurrency control/consistency is...
        > > VC[/color]
        >
        > The problem here VC, as I see it, is that you need to go take a decent
        > class on database architecture. You meet with ease the criteria to wear
        > the button that says "A little knowledge is a dangerous thing."[/color]

        Where was VC wrong? Where is the refutation of his argument? Name calling
        only makes you look bad, and my sons did it when they were five years old
        and were frustrated that they couldn't get their way.[color=blue]
        >[/color]
        VC was absolutely correct and was perfectly behaved in his discussion with
        you. I wish I could stomach the B.S. as well as he did. You should *not*
        be teaching anything if you claim to know general principles of good
        database design or the relational model and drag it into your discussions of
        low level Oracle instance configuration settings.
        [color=blue]
        > Daniel Morgan
        >[/color]

        - Dan


        Comment

        • Daniel Morgan

          #94
          Re: oracle - mysql comparison

          Dan wrote:[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 already mentioned several times, no one disputes the fact that[/color][/color]
          >
          > in
          >[color=green][color=darkred]
          >>>certain cases Oracle provides higher concurrency due to MVCC.[/color]
          >>
          >>Agreed.
          >>
          >>[color=darkred]
          >>>I also said that there are several solutions to the reporting problem in
          >>>locking databases, such as a replicated or stand-by database.[/color]
          >>
          >>Many believe this but it is patently false. What do you do about
          >>transaction s that take place while you are replicating the database?
          >>
          >>You either lock the table while replicating or the replication is also
          >>not consistent to a point-in-time. You can not have it both ways.
          >>
          >> There is
          >>[color=darkred]
          >>>another solution, namely triple mirroring of the OLTP database. SAN[/color][/color]
          >
          > vendor
          >[color=green][color=darkred]
          >>>harware can "split off" the third mirrored drive set creating almost
          >>>instantaneou sly a clone of the original database (e.g. EMC BCV) at a[/color][/color]
          >
          > given
          >[color=green][color=darkred]
          >>>point in time. It's interesting to notice, that the same technique is
          >>>widely used for Oracle databases as well in order to off-load the main
          >>>instance. The clone is used both for reporting and backups.[/color]
          >>
          >>Almost instantly means ALMOST consistent to a point-in-time. But now you
          >>are talking about data consistency by hardware intervention which is
          >>just as valid if we were talking about 3x5 cards and a photocopier.
          >>
          >>[color=darkred]
          >>>>Serialize to your hearts content ... you aren't going to do it without
          >>>>a full table lock ...
          >>>[/color][/color]
          >[color=green][color=darkred]
          >>>As I've demonstrated, only a subset of rows involved in the transaction[/color][/color]
          >
          > 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. And you have no means of keeping
          >>them out of your result set except a full table lock.
          >>[/color]
          >
          >
          > Absolutely not true.
          >
          > There is a critical difference between the notion of 'serialized' and the
          > term 'serializable'. Perhaps you could look it up? If not, Phil Bernstein,
          > the guy that literally wrote the book on the subject is a real professor at
          > the University of Washington. You might be able to catch a class...
          >
          > Once you understand the difference in terminology, then perhaps you'll
          > understand why you don't need a full table lock to ensure a serializable
          > schedule even when a concurrent transaction inserts a row (again! in
          > contrast to serialized).
          >
          >[color=green]
          >>Daniel Morgan
          >>[/color]
          >
          > - Dan[/color]

          No doubt you thought you understood what I intended. I did not once
          mention serialized or serializable did I?

          Daniel Morgan

          Comment

          • Daniel Morgan

            #95
            Re: oracle - mysql comparison

            Dan wrote:
            [color=blue]
            > Where was VC wrong?[/color]
            [color=blue]
            > - Dan[/color]

            When you respond to what I wrote rather than what you wrote I wrote I
            will gladly respond.

            From where I am reading ... you came into a conversation in the middle
            and are not tracking on the point I have been trying to make which
            relates to point-in-time accuracy. I have NOT once made reference to
            any type of cereal: Not Corn Flakes, Not Cheerios, Not Oat Meal.
            Hope you now have a sense of how I feel reading what you wrote. Hope
            you are thinking "I wrote serial not cereal."

            Daniel Morgan

            Comment

            • Daniel Morgan

              #96
              Re: oracle - mysql comparison

              michael newport wrote:
              [color=blue]
              > you can replace Oracle with Ingres, this is what I mean;
              >
              > and very soon you can use Ingres for free.
              >
              > http://news.com.com/CA+open-sources+...l?tag=nefd.top[/color]

              And lose a lot of critical functionality.

              Daniel Morgan

              Comment

              • michael newport

                #97
                Re: oracle - mysql comparison

                such as ?

                Comment

                • Daniel Morgan

                  #98
                  Re: oracle - mysql comparison

                  VC wrote:
                  [color=blue]
                  > As I've already mentioned several times, no one disputes the fact that in
                  > certain cases Oracle provides higher concurrency due to MVCC.[/color]

                  Agreed.
                  [color=blue]
                  > I also said that there are several solutions to the reporting problem in
                  > locking databases, such as a replicated or stand-by database.[/color]

                  Many believe this but it is patently false. What do you do about
                  transactions that take place while you are replicating the database?

                  You either lock the table while replicating or the replication is also
                  not consistent to a point-in-time. You can not have it both ways.

                  There is[color=blue]
                  > another solution, namely triple mirroring of the OLTP database. SAN vendor
                  > harware can "split off" the third mirrored drive set creating almost
                  > instantaneously a clone of the original database (e.g. EMC BCV) at a given
                  > point in time. It's interesting to notice, that the same technique is
                  > widely used for Oracle databases as well in order to off-load the main
                  > instance. The clone is used both for reporting and backups.[/color]

                  Almost instantly means ALMOST consistent to a point-in-time. But now you
                  are talking about data consistency by hardware intervention which is
                  just as valid if we were talking about 3x5 cards and a photocopier.
                  [color=blue][color=green]
                  >>Serialize to your hearts content ... you aren't going to do it without
                  >>a full table lock ...[/color]
                  >
                  > As I've demonstrated, only a subset of rows involved in the transaction has
                  > 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. And you have no means of keeping
                  them out of your result set except a full table lock.

                  Daniel Morgan

                  Comment

                  • Daniel Morgan

                    #99
                    Re: oracle - mysql comparison

                    Volker Hetzer wrote:
                    [color=blue]
                    > "VC" <boston103@hotm ail.com> schrieb im Newsbeitrag news:RfdLc.1093 72$WX.92600@att bi_s51...
                    >[color=green]
                    >>Here's another textbook example for you:
                    >>==
                    >>There are two linked accounts (id=1 and id=2) in a bank. A transaction
                    >>might look as follows:
                    >>
                    >>== withdraw from 1
                    >>select amount into x from accounts where id=1
                    >>select amount into y from accounts where id=2
                    >>if x+y >= withdrawal then update accounts set amount=amount-withdrawal
                    >>where id=1
                    >>commit
                    >>=====
                    >>
                    >>Any commercial locking scheduler will handle the scenario correctly. Oracle
                    >>won't.[/color]
                    >
                    > Sorry for butting in but I'm just trying to learn here, so what would go wrong?
                    > And what about "select for update" in oracle? It's supposed to lock the rows it hits.
                    >
                    > Lots of Greetings!
                    > Volker[/color]

                    You are correct and VC, as I earlier stated to him, is demonstrating far
                    less than a robust understanding of transaction processing: Lots of
                    smoke but no fire.

                    Daniel Morgan

                    Comment

                    • Daniel Morgan

                      Re: oracle - mysql comparison

                      VC wrote:
                      [color=blue]
                      > "Alex Filonov" <afilonov@yahoo .com> wrote in message
                      > news:336da121.0 407201338.62eab 435@posting.goo gle.com...
                      >[color=green]
                      >>"VC" <boston103@hotm ail.com> wrote in message[/color]
                      >
                      > news:<p_XKc.135 317$XM6.125873@ attbi_s53>...
                      >[color=green][color=darkred]
                      >>>Under DB2/MSSQL, a transaction will lock only a subset of rows (not the
                      >>>whole table) for a given flight thus ensuring consistent results
                      >>>[/color]
                      >>
                      >>I've said in another post that it's a crappy example. A little bit more on
                      >>that.[/color]
                      >
                      >
                      > You are attacking a strawman -- the design is not what's being discussed
                      > here, concurrency control/consistency is...
                      > VC[/color]

                      The problem here VC, as I see it, is that you need to go take a decent
                      class on database architecture. You meet with ease the criteria to wear
                      the button that says "A little knowledge is a dangerous thing."

                      Daniel Morgan

                      Comment

                      • VC

                        Re: oracle - mysql comparison


                        "Daniel Morgan" <damorgan@x.was hington.edu> wrote in message
                        news:1090378179 .508307@yasure. ..[color=blue]
                        > VC wrote:[color=green]
                        > > As I've demonstrated, only a subset of rows involved in the transaction[/color][/color]
                        has[color=blue][color=green]
                        > > 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 the
                        FLIGHT_NUMBER=9 99 predicate, but also the relevant index (P_Idx) range thus
                        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 the
                        way, has it too.
                        [color=blue]
                        >And you have no means of keeping
                        > them out of your result set except a full table lock.[/color]

                        See above.

                        VC


                        Comment

                        • Volker Hetzer

                          Re: oracle - mysql comparison


                          "Dan" <guntermannxxx@ verizon.com> schrieb im Newsbeitrag news:OylLc.3304 2$lz2.13858@nwr ddc03.gnilink.n et...[color=blue]
                          > There is a critical difference between the notion of 'serialized' and the
                          > term 'serializable'. Perhaps you could look it up? If not, Phil Bernstein,
                          > the guy that literally wrote the book on the subject is a real professor at
                          > the University of Washington. You might be able to catch a class...[/color]
                          Looks like this thread was worth catching up...
                          Which book do you mean,
                          http://www.amazon.com/exec/obidos/tg...books&n=507846 ?

                          And what about

                          and

                          .. Any opinion on those? I have no problem with the price but I wouldn't like to waste money either. I work as DBA and developer.

                          Lots of greetings and thanks!
                          Volker

                          Comment

                          • Dan

                            Re: oracle - mysql comparison


                            "Daniel Morgan" <damorgan@x.was hington.edu> wrote in message
                            news:1090378179 .508307@yasure. ..[color=blue]
                            > VC wrote:
                            >[color=green]
                            > > As I've already mentioned several times, no one disputes the fact that[/color][/color]
                            in[color=blue][color=green]
                            > > certain cases Oracle provides higher concurrency due to MVCC.[/color]
                            >
                            > Agreed.
                            >[color=green]
                            > > I also said that there are several solutions to the reporting problem in
                            > > locking databases, such as a replicated or stand-by database.[/color]
                            >
                            > Many believe this but it is patently false. What do you do about
                            > transactions that take place while you are replicating the database?
                            >
                            > You either lock the table while replicating or the replication is also
                            > not consistent to a point-in-time. You can not have it both ways.
                            >
                            > There is[color=green]
                            > > another solution, namely triple mirroring of the OLTP database. SAN[/color][/color]
                            vendor[color=blue][color=green]
                            > > harware can "split off" the third mirrored drive set creating almost
                            > > instantaneously a clone of the original database (e.g. EMC BCV) at a[/color][/color]
                            given[color=blue][color=green]
                            > > point in time. It's interesting to notice, that the same technique is
                            > > widely used for Oracle databases as well in order to off-load the main
                            > > instance. The clone is used both for reporting and backups.[/color]
                            >
                            > Almost instantly means ALMOST consistent to a point-in-time. But now you
                            > are talking about data consistency by hardware intervention which is
                            > just as valid if we were talking about 3x5 cards and a photocopier.
                            >[color=green][color=darkred]
                            > >>Serialize to your hearts content ... you aren't going to do it without
                            > >>a full table lock ...[/color]
                            > >[/color][/color]
                            [color=blue][color=green]
                            > > As I've demonstrated, only a subset of rows involved in the transaction[/color][/color]
                            has[color=blue][color=green]
                            > > 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. And you have no means of keeping
                            > them out of your result set except a full table lock.
                            >[/color]

                            Absolutely not true.

                            There is a critical difference between the notion of 'serialized' and the
                            term 'serializable'. Perhaps you could look it up? If not, Phil Bernstein,
                            the guy that literally wrote the book on the subject is a real professor at
                            the University of Washington. You might be able to catch a class...

                            Once you understand the difference in terminology, then perhaps you'll
                            understand why you don't need a full table lock to ensure a serializable
                            schedule even when a concurrent transaction inserts a row (again! in
                            contrast to serialized).
                            [color=blue]
                            > Daniel Morgan
                            >[/color]
                            - Dan


                            Comment

                            • Dan

                              Re: oracle - mysql comparison


                              "Daniel Morgan" <damorgan@x.was hington.edu> wrote in message
                              news:1090378283 .651396@yasure. ..[color=blue]
                              > Volker Hetzer wrote:
                              >[color=green]
                              > > "VC" <boston103@hotm ail.com> schrieb im Newsbeitrag[/color][/color]
                              news:RfdLc.1093 72$WX.92600@att bi_s51...[color=blue][color=green]
                              > >[color=darkred]
                              > >>Here's another textbook example for you:
                              > >>==
                              > >>There are two linked accounts (id=1 and id=2) in a bank. A transaction
                              > >>might look as follows:
                              > >>
                              > >>== withdraw from 1
                              > >>select amount into x from accounts where id=1
                              > >>select amount into y from accounts where id=2
                              > >>if x+y >= withdrawal then update accounts set amount=amount-withdrawal
                              > >>where id=1
                              > >>commit
                              > >>=====
                              > >>
                              > >>Any commercial locking scheduler will handle the scenario correctly.[/color][/color][/color]
                              Oracle[color=blue][color=green][color=darkred]
                              > >>won't.[/color]
                              > >
                              > > Sorry for butting in but I'm just trying to learn here, so what would go[/color][/color]
                              wrong?[color=blue][color=green]
                              > > And what about "select for update" in oracle? It's supposed to lock the[/color][/color]
                              rows it hits.[color=blue][color=green]
                              > >
                              > > Lots of Greetings!
                              > > Volker[/color]
                              >
                              > You are correct and VC, as I earlier stated to him, is demonstrating far
                              > less than a robust understanding of transaction processing: Lots of
                              > smoke but no fire.
                              >[/color]

                              VC already explained it. Serializable schedules are always preferrable to
                              serialized schedules. The 'FOR UPDATE' clause is a hack that only results
                              in a *serialized* sequence of transactions.

                              Again, you need to understand the difference between serialized and
                              serializable, and you need to either take a basic database course or read a
                              textbook. All I see from you is a bunch of hand waving. If someone asks a
                              question in the middle of some private war of yours, you latch on like the
                              guy is backing you up. VC gave more than ample evidence and he was very
                              patient in explaining it to you, but you chose to ignore him. Why? Can you
                              address issues in a more apolitical manner? Do you always have to have the
                              last word, even if it makes you look like a moron?

                              The emporer really has no clothes.
                              [color=blue]
                              > Daniel Morgan
                              >[/color]
                              - Dan


                              Comment

                              • Dan

                                Re: oracle - mysql comparison


                                "Daniel Morgan" <damorgan@x.was hington.edu> wrote in message
                                news:1090378462 .109262@yasure. ..[color=blue]
                                > VC wrote:
                                >[color=green]
                                > > "Alex Filonov" <afilonov@yahoo .com> wrote in message
                                > > news:336da121.0 407201338.62eab 435@posting.goo gle.com...
                                > >[color=darkred]
                                > >>"VC" <boston103@hotm ail.com> wrote in message[/color]
                                > >
                                > > news:<p_XKc.135 317$XM6.125873@ attbi_s53>...
                                > >[color=darkred]
                                > >>>Under DB2/MSSQL, a transaction will lock only a subset of rows (not[/color][/color][/color]
                                the[color=blue][color=green][color=darkred]
                                > >>>whole table) for a given flight thus ensuring consistent results
                                > >>>
                                > >>
                                > >>I've said in another post that it's a crappy example. A little bit more[/color][/color][/color]
                                on[color=blue][color=green][color=darkred]
                                > >>that.[/color]
                                > >
                                > >
                                > > You are attacking a strawman -- the design is not what's being discussed
                                > > here, concurrency control/consistency is...
                                > > VC[/color]
                                >
                                > The problem here VC, as I see it, is that you need to go take a decent
                                > class on database architecture. You meet with ease the criteria to wear
                                > the button that says "A little knowledge is a dangerous thing."[/color]

                                Where was VC wrong? Where is the refutation of his argument? Name calling
                                only makes you look bad, and my sons did it when they were five years old
                                and were frustrated that they couldn't get their way.[color=blue]
                                >[/color]
                                VC was absolutely correct and was perfectly behaved in his discussion with
                                you. I wish I could stomach the B.S. as well as he did. You should *not*
                                be teaching anything if you claim to know general principles of good
                                database design or the relational model and drag it into your discussions of
                                low level Oracle instance configuration settings.
                                [color=blue]
                                > Daniel Morgan
                                >[/color]

                                - Dan


                                Comment

                                Working...