[MDEV-15864] Index condition in ANALYSE FORMAT=JSON shows the same condition twice Created: 2018-04-13  Updated: 2021-03-19

Status: Open
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.1, 10.2
Fix Version/s: 10.1

Type: Bug Priority: Minor
Reporter: Varun Gupta (Inactive) Assignee: Sergei Petrunia
Resolution: Unresolved Votes: 0
Labels: None

Attachments: File mdev15864.sql    

 Description   

analyze format=json select * from t1,t1_subsets where t1.subset_id IS NOT NULL and t1.subset_id= t1_subsets.id;
ANALYZE
{
  "query_block": {
    "select_id": 1,
    "r_loops": 1,
    "r_total_time_ms": 0.0594,
    "table": {
      "table_name": "t1",
      "access_type": "range",
      "possible_keys": ["t1_subset_id"],
      "key": "t1_subset_id",
      "key_length": "5",
      "used_key_parts": ["subset_id"],
      "r_loops": 1,
      "rows": 3,
      "r_rows": 0,
      "r_total_time_ms": 0.0226,
      "filtered": 100,
      "r_filtered": 100,
      "index_condition": "((t1.subset_id is not null) and (t1.subset_id is not null))"
    },
    "table": {
      "table_name": "t1_subsets",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "4",
      "used_key_parts": ["id"],
      "ref": ["test.t1.subset_id"],
      "r_loops": 0,
      "rows": 1,
      "r_rows": null,
      "filtered": 100,
      "r_filtered": null,
      "index_condition": "(t1.subset_id = t1_subsets.`id`)"
    }
  }
}

So if you look at the first table t1, we have an index condition as
"index_condition": "((t1.subset_id is not null) and (t1.subset_id is not null))". So we have the same condition twice here which i think is adding an overhead and we should remove the duplication here.


Generated at Thu Feb 08 08:24:36 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.