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

range optimizer calls records_in_range() for full extended keys

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 10.1(EOL)
    • 10.1.15
    • Optimizer
    • None

    Description

      Debugging MDEV-10046, I have discovered that range optimizer will call records_in_range() when we have a full equality range for an extended index.

      Example:

      create table t1 (
        pk int primary key,
        col1 int,
        ...
        index IDX1(col1)
      );
      

      explain select * from t1 where col1 IN (c11, c12, ...) and pk IN (c21, c22, ..)
      

      Here, when doing range analysis for IDX1, we get ranges in form:

      (col1, pk)= (c11, c21)
      

      When PK is a part of the index, there is no need to call records_in_range: we don't call it for unique indexes, InnoDB internally is set to return 1 when it sees a zero estimate.

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              psergei Sergei Petrunia
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.