MySQL InnoDB: how to interpret this InnoDB monitor output of Next-Key locks?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0
















Next-Key Locks from MySQL documentation



A next-key lock is a combination of a record lock on the index record and a gap lock on the gap before the index record.



InnoDB performs row-level locking in such a way that when it searches or scans a table index, it sets shared or exclusive locks on the index records it encounters. Thus, the row-level locks are actually index-record locks. A next-key lock on an index record also affects the “gap” before that index record. That is, a next-key lock is an index-record lock plus a gap lock on the gap preceding the index record. If one session has a shared or exclusive lock on record R in an index, another session cannot insert a new index record in the gap immediately before R in the index order.




Show InnoDB engine status



(negative infinity, 10]
(10, 11]
(11, 13]
(13, 20]
(20, positive infinity)


MySQL documentation also provide an example to explain what does Show engine InnoDB status output looks likes.



RECORD LOCKS space id 58 page no 3 n bits 72 index `PRIMARY` of table `test`.`t` 
trx id 10080 lock_mode X
Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0
0: len 8; hex 73757072656d756d; asc supremum;;

Record lock, heap no 2 PHYSICAL RECORD: n_fields 3; compact format; info bits 0
0: len 4; hex 8000000a; asc ;;
1: len 6; hex 00000000274f; asc 'O;;
2: len 7; hex b60000019d0110; asc ;;


The strange thing is there is no next key lock appears in this output, instead, two record locks.



My Questions





  1. why are there two record lock rather than next key lock in this report?



    enter image description here



  2. What does 73757072656d756d mean? I found this hex in lots of Stack Overflow question.


  3. What does supremum mean? the supremum of B+ leaf node?


  4. What does these lines mean?



enter image description here










share|improve this question





























    0
















    Next-Key Locks from MySQL documentation



    A next-key lock is a combination of a record lock on the index record and a gap lock on the gap before the index record.



    InnoDB performs row-level locking in such a way that when it searches or scans a table index, it sets shared or exclusive locks on the index records it encounters. Thus, the row-level locks are actually index-record locks. A next-key lock on an index record also affects the “gap” before that index record. That is, a next-key lock is an index-record lock plus a gap lock on the gap preceding the index record. If one session has a shared or exclusive lock on record R in an index, another session cannot insert a new index record in the gap immediately before R in the index order.




    Show InnoDB engine status



    (negative infinity, 10]
    (10, 11]
    (11, 13]
    (13, 20]
    (20, positive infinity)


    MySQL documentation also provide an example to explain what does Show engine InnoDB status output looks likes.



    RECORD LOCKS space id 58 page no 3 n bits 72 index `PRIMARY` of table `test`.`t` 
    trx id 10080 lock_mode X
    Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0
    0: len 8; hex 73757072656d756d; asc supremum;;

    Record lock, heap no 2 PHYSICAL RECORD: n_fields 3; compact format; info bits 0
    0: len 4; hex 8000000a; asc ;;
    1: len 6; hex 00000000274f; asc 'O;;
    2: len 7; hex b60000019d0110; asc ;;


    The strange thing is there is no next key lock appears in this output, instead, two record locks.



    My Questions





    1. why are there two record lock rather than next key lock in this report?



      enter image description here



    2. What does 73757072656d756d mean? I found this hex in lots of Stack Overflow question.


    3. What does supremum mean? the supremum of B+ leaf node?


    4. What does these lines mean?



    enter image description here










    share|improve this question

























      0












      0








      0









      Next-Key Locks from MySQL documentation



      A next-key lock is a combination of a record lock on the index record and a gap lock on the gap before the index record.



      InnoDB performs row-level locking in such a way that when it searches or scans a table index, it sets shared or exclusive locks on the index records it encounters. Thus, the row-level locks are actually index-record locks. A next-key lock on an index record also affects the “gap” before that index record. That is, a next-key lock is an index-record lock plus a gap lock on the gap preceding the index record. If one session has a shared or exclusive lock on record R in an index, another session cannot insert a new index record in the gap immediately before R in the index order.




      Show InnoDB engine status



      (negative infinity, 10]
      (10, 11]
      (11, 13]
      (13, 20]
      (20, positive infinity)


      MySQL documentation also provide an example to explain what does Show engine InnoDB status output looks likes.



      RECORD LOCKS space id 58 page no 3 n bits 72 index `PRIMARY` of table `test`.`t` 
      trx id 10080 lock_mode X
      Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0
      0: len 8; hex 73757072656d756d; asc supremum;;

      Record lock, heap no 2 PHYSICAL RECORD: n_fields 3; compact format; info bits 0
      0: len 4; hex 8000000a; asc ;;
      1: len 6; hex 00000000274f; asc 'O;;
      2: len 7; hex b60000019d0110; asc ;;


      The strange thing is there is no next key lock appears in this output, instead, two record locks.



      My Questions





      1. why are there two record lock rather than next key lock in this report?



        enter image description here



      2. What does 73757072656d756d mean? I found this hex in lots of Stack Overflow question.


      3. What does supremum mean? the supremum of B+ leaf node?


      4. What does these lines mean?



      enter image description here










      share|improve this question















      Next-Key Locks from MySQL documentation



      A next-key lock is a combination of a record lock on the index record and a gap lock on the gap before the index record.



      InnoDB performs row-level locking in such a way that when it searches or scans a table index, it sets shared or exclusive locks on the index records it encounters. Thus, the row-level locks are actually index-record locks. A next-key lock on an index record also affects the “gap” before that index record. That is, a next-key lock is an index-record lock plus a gap lock on the gap preceding the index record. If one session has a shared or exclusive lock on record R in an index, another session cannot insert a new index record in the gap immediately before R in the index order.




      Show InnoDB engine status



      (negative infinity, 10]
      (10, 11]
      (11, 13]
      (13, 20]
      (20, positive infinity)


      MySQL documentation also provide an example to explain what does Show engine InnoDB status output looks likes.



      RECORD LOCKS space id 58 page no 3 n bits 72 index `PRIMARY` of table `test`.`t` 
      trx id 10080 lock_mode X
      Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0
      0: len 8; hex 73757072656d756d; asc supremum;;

      Record lock, heap no 2 PHYSICAL RECORD: n_fields 3; compact format; info bits 0
      0: len 4; hex 8000000a; asc ;;
      1: len 6; hex 00000000274f; asc 'O;;
      2: len 7; hex b60000019d0110; asc ;;


      The strange thing is there is no next key lock appears in this output, instead, two record locks.



      My Questions





      1. why are there two record lock rather than next key lock in this report?



        enter image description here



      2. What does 73757072656d756d mean? I found this hex in lots of Stack Overflow question.


      3. What does supremum mean? the supremum of B+ leaf node?


      4. What does these lines mean?



      enter image description here







      mysql innodb locking deadlock






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 13 mins ago









      Ryan LvRyan Lv

      16318




      16318






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f234622%2fmysql-innodb-how-to-interpret-this-innodb-monitor-output-of-next-key-locks%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f234622%2fmysql-innodb-how-to-interpret-this-innodb-monitor-output-of-next-key-locks%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Liste der Baudenkmale in Friedland (Mecklenburg)

          Single-Malt-Whisky

          Czorneboh