Query time 0.00272
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": 55,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (6536,21063,1784,6545,1747,1056,79,5765,1711,585,1749,48850,23172,40811,4271,1756,5769,24798,6543,40808,4272,5772,14982,5759,1745,4939,2128,1748,23481,6467,48847,1751)"
}
},
{
"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 |
79 |
122M |
|
585 |
123M |
|
1056 |
210,209,409,160M |
|
1711 |
123M |
|
1745 |
183M |
|
1747 |
183M |
|
1748 |
183M |
|
1749 |
183M |
|
1751 |
183M |
|
1756 |
183M |
|
1784 |
313M |
|
2128 |
123M |
|
4271 |
209,316M |
|
4272 |
209,316M |
|
4939 |
316,317M |
|
5759 |
184M |
|
5765 |
183,315M |
|
5769 |
213,184M |
|
5772 |
184M |
|
6467 |
122M |
|
6536 |
118M |
|
6543 |
211,212,412,119M |
|
6545 |
213,412,119M |
|
14982 |
117M |
|
21063 |
120M |
|
23172 |
199M |
|
23481 |
209,160M |
|
24798 |
124M |
|
40808 |
124M |
|
40811 |
126M |
|
48847 |
209,153M |
|
48850 |
209,153M |
|