Query time 0.00083
JSON explain
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "p",
"access_type": "range",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["product_id"],
"rows": 12,
"filtered": 100,
"attached_condition": "p.product_id in (317,189,501,293,78,35,234,331,484,287,292,79)",
"using_index": true
},
"table": {
"table_name": "cscart_discussion",
"access_type": "ref",
"possible_keys": ["PRIMARY", "object_id"],
"key": "object_id",
"key_length": "6",
"used_key_parts": ["object_id", "object_type"],
"ref": ["orbit_cscart_orbit_cscart.p.product_id", "const"],
"rows": 1,
"filtered": 100,
"index_condition": "cscart_discussion.object_type = 'P'"
},
"table": {
"table_name": "dp",
"access_type": "ref",
"possible_keys": ["thread_id", "thread_id_2"],
"key": "thread_id_2",
"key_length": "6",
"used_key_parts": ["thread_id", "status"],
"ref": ["orbit_cscart_orbit_cscart.cscart_discussion.thread_id", "const"],
"rows": 7,
"filtered": 100,
"index_condition": "dp.`status` = 'A'"
}
}
}
Result
| product_id |
discussion_amount_posts |
| 78 |
6 |
| 79 |
5 |
| 234 |
1 |
| 287 |
5 |
| 292 |
7 |
| 317 |
3 |
| 484 |
2 |