Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-21535

Unnecessarily large ha_innobase::records_in_range() scans

Details

    Description

      The recently added test innodb.innodb_wl6326 hangs in 10.4, because a query

      SELECT a00,a01 FROM t1 WHERE a00 = 'cp';
      

      causes ha_innobase::records_in_range() to be called with min_key=NULL. No secondary indexes have been defined on the table; only PRIMARY KEY(a00,a01,a02,a03,a04,a05,a06).

      That section of the test is demonstrating that only some pages of the table are supposed to be latched.

      The hang is caused by ‘too broad’ ha_innobase::records_in_range() calls. Those calls were introduced by an early commit of MDEV-16188. With the parent of that commit, the following test will not hang:

      git checkout bc43bf3e430c20bc2178e584215bd443054709d6 mysql-test/suite/innodb/t/innodb_wl6326.*
      (cd path/to/build/mysql-test; ./mtr innodb.innodb_wl6326)
      

      I would expect the too broad ha_innobase::records_in_range() calls to cause a performance regression, especially if they are being invoked for each and every query. InnoDB will not cache the results of that call in any way.

      Attachments

        Issue Links

          Activity

            marko Marko Mäkelä created issue -
            marko Marko Mäkelä made changes -
            Field Original Value New Value
            marko Marko Mäkelä made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Attachment MDEV-21535-workaround.patch [ 50544 ]
            monty Michael Widenius made changes -
            Assignee Igor Babaev [ igor ] Michael Widenius [ monty ]
            monty Michael Widenius made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            marko Marko Mäkelä made changes -
            issue.field.resolutiondate 2020-04-08 07:06:36.0 2020-04-08 07:06:36.634
            marko Marko Mäkelä made changes -
            Fix Version/s 10.4.13 [ 24223 ]
            Fix Version/s 10.5.2 [ 24030 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            marko Marko Mäkelä made changes -
            Resolution Fixed [ 1 ]
            Status Closed [ 6 ] Stalled [ 10000 ]
            marko Marko Mäkelä made changes -
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.5.2 [ 24030 ]
            marko Marko Mäkelä made changes -
            Assignee Michael Widenius [ monty ] Marko Mäkelä [ marko ]
            marko Marko Mäkelä made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            issue.field.resolutiondate 2020-04-14 16:14:40.0 2020-04-14 16:14:40.058
            marko Marko Mäkelä made changes -
            Fix Version/s 10.5.2 [ 24030 ]
            Fix Version/s 10.5 [ 23123 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 103184 ] MariaDB v4 [ 157224 ]
            marko Marko Mäkelä made changes -

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.