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

Unnecessary condition used in Index Condition Pushdown

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: In Review (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.5, 10.0, 10.1, 10.2, 10.3
    • Fix Version/s: 5.5, 10.0, 10.1, 10.2, 10.3, 10.4
    • Component/s: None
    • Labels:
      None

      Description

      EXPLAIN SELECT MIN(b), MIN(c) FROM t1 WHERE a = 1;
      id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
      1	SIMPLE	t1	ref	a	a	5	const	2	Using index condition
      analyze format=json
      SELECT MIN(b), MIN(c) FROM t1 WHERE a = 1;
      ANALYZE
      {
        "query_block": {
          "select_id": 1,
          "r_loops": 1,
          "r_total_time_ms": 0.0893,
          "table": {
            "table_name": "t1",
            "access_type": "ref",
            "possible_keys": ["a"],
            "key": "a",
            "key_length": "5",
            "used_key_parts": ["a"],
            "ref": ["const"],
            "r_loops": 1,
            "rows": 2,
            "r_rows": 3,
            "r_total_time_ms": 0.0462,
            "filtered": 100,
            "r_filtered": 100,
            "index_condition": "1"
          }
        }
      }
      

      So here we see that we have a pushed index condition but as you see that is a constant , not mentioned in the where clause of the query. So we should not be having such a index condition.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated: