|
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.
|