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

range optimizer calls records_in_range() for full extended keys

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.1
    • Fix Version/s: 10.1.15
    • Component/s: Optimizer
    • Labels:
      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

              Assignee:
              psergey Sergei Petrunia
              Reporter:
              psergey Sergei Petrunia
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: