Query time 0.01360
JSON explain
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "tl",
"access_type": "ref",
"possible_keys": ["PRIMARY", "tag_id", "ids", "idx_tag_id", "idx_object_id"],
"key": "ids",
"key_length": "6",
"used_key_parts": ["tag_id", "object_type"],
"ref": ["const", "const"],
"rows": 1988,
"filtered": 98.94316864,
"attached_condition": "tl.object_type = 'P'",
"using_index": true
},
"table": {
"table_name": "p",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "status", "idx_company_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["devmotorsbay.tl.object_id"],
"rows": 1,
"filtered": 98.3818512,
"attached_condition": "p.`status` = 'A'"
},
"table": {
"table_name": "companies",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["company_id"],
"ref": ["devmotorsbay.p.company_id"],
"rows": 1,
"filtered": 100,
"index_condition": "companies.company_id in (1,3,5,6,7,8,10,11,12,13,15)",
"attached_condition": "companies.`status` = 'A'"
},
"table": {
"table_name": "pc",
"access_type": "ref",
"possible_keys": ["PRIMARY", "pt"],
"key": "pt",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["devmotorsbay.tl.object_id"],
"rows": 1,
"filtered": 100
},
"table": {
"table_name": "c",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "p_category_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["category_id"],
"ref": ["devmotorsbay.pc.category_id"],
"rows": 1,
"filtered": 100,
"attached_condition": "c.storefront_id in (0,4) and !<in_optimizer>(1,exists(subquery#2)) and c.`status` = 'A'"
},
"subqueries": [
{
"expression_cache": {
"state": "uninitialized",
"query_block": {
"select_id": 2,
"table": {
"table_name": "mb_sitemap_tag_path_categories",
"access_type": "ALL",
"rows": 445,
"filtered": 100,
"attached_condition": "find_in_set(mb_sitemap_tag_path_categories.category_id,replace(c.id_path,'/',',')) and mb_sitemap_tag_path_categories.storefront_id not in (0,4)"
}
}
}
}
]
}
}
Result
| COUNT(DISTINCT p.product_id) |
| 0 |