Query time 0.01016
JSON explain
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "range",
"possible_keys": ["PRIMARY", "pt"],
"key": "pt",
"key_length": "3",
"used_key_parts": ["product_id"],
"rows": 105,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (48039,48553,47666,48654,48735,48044,48687,48042,48948,48621,47932,48047,48046,48716,48789,48656,48655,48686,48554,48691,48689,49583,47362,48785,48784,48525,47618,48624,48523,49149,48524,48787)"
}
},
{
"table": {
"table_name": "cscart_categories",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "c_status", "p_category_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["category_id"],
"ref": ["dev_db.cscart_products_categories.category_id"],
"rows": 1,
"filtered": 100,
"attached_condition": "cscart_categories.storefront_id in (0,1) and (cscart_categories.usergroup_ids = '' or find_in_set(0,cscart_categories.usergroup_ids) or find_in_set(1,cscart_categories.usergroup_ids)) and cscart_categories.`status` in ('A','H')"
}
},
{
"table": {
"table_name": "product_position_source",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "pt"],
"key": "PRIMARY",
"key_length": "6",
"used_key_parts": ["category_id", "product_id"],
"ref": ["const", "dev_db.cscart_products_categories.product_id"],
"rows": 1,
"filtered": 100
}
}
]
}
}
Result
product_id |
category_ids |
position |
47362 |
211,213,201M |
0 |
47618 |
210,212,213,166M |
0 |
47666 |
213,110,119,118M |
0 |
47932 |
110,116,213M |
0 |
48039 |
213,169,210M |
0 |
48042 |
213,210,412,169M |
0 |
48044 |
213,210,412,169M |
0 |
48046 |
213,169M |
0 |
48047 |
213,169M |
0 |
48523 |
210,213,122M |
0 |
48524 |
210,213,122M |
0 |
48525 |
210,213,122M |
0 |
48553 |
213,111M |
0 |
48554 |
213,111M |
0 |
48621 |
213,211,201M |
0 |
48624 |
213,211,201M |
0 |
48654 |
212,213,199M |
0 |
48655 |
213,212,199M |
0 |
48656 |
212,213,199M |
0 |
48686 |
213,315,210,169M |
0 |
48687 |
210,213,315,169M |
0 |
48689 |
210,213,315,169M |
0 |
48691 |
213,315,210,169M |
0 |
48716 |
409,315,210,213,169M |
0 |
48735 |
213,315,210,412,169M |
0 |
48784 |
209,213,210M |
0 |
48785 |
210,209,213M |
0 |
48787 |
210,209,213M |
0 |
48789 |
210,209,213M |
0 |
48948 |
110,213,199M |
0 |
49149 |
213,193M |
0 |
49583 |
213,210,193M |
0 |