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

Wrong method to access a table with extended_keys=on

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5.28
    • Fix Version/s: 5.5.28a
    • Component/s: None
    • Labels:
      None

      Description

      The following test case for the database dbt3_s001 from innodb_ext_key.test
      returns the execution plan with REF access method though EQ_REF is expected.

      create table t0 (a int);
      insert into t0 values (1), (2), (3), (4), (5);
      create index i_p_size on part(p_size);
      set optimizer_switch='extended_keys=on';
      explain
      select * from t0, part ignore index (primary)
      where p_partkey=t0.a and p_size=1;

      MariaDB [dbt3_s001]> explain select * from t0, part ignore index (primary) where p_partkey=t0.a and p_size=1\G

                                                          • 1. row ***************************
                                                            id: 1
                                                            select_type: SIMPLE
                                                            table: t0
                                                            type: ALL
                                                            possible_keys: NULL
                                                            key: NULL
                                                            key_len: NULL
                                                            ref: NULL
                                                            rows: 5
                                                            Extra: Using where
                                                          • 2. row ***************************
                                                            id: 1
                                                            select_type: SIMPLE
                                                            table: part
                                                            type: ref
                                                            possible_keys: i_p_size
                                                            key: i_p_size
                                                            key_len: 9
                                                            ref: const,dbt3_s001.t0.a
                                                            rows: 1
                                                            Extra:
                                                            2 rows in set (0.00 sec)

        Attachments

          Activity

            People

            • Assignee:
              igor Igor Babaev
              Reporter:
              igor Igor Babaev
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: