Query time 0.00049
JSON explain
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "cscart_discussion",
"access_type": "range",
"possible_keys": ["object_id"],
"key": "object_id",
"key_length": "6",
"used_key_parts": ["object_id", "object_type"],
"rows": 11,
"filtered": 100,
"index_condition": "cscart_discussion.object_id in (64276,64757,64944,64756,65099,65095,64759,64758,64848,63814,65300) and cscart_discussion.object_type = 'P'"
},
"table": {
"table_name": "cscart_discussion_posts",
"access_type": "ref",
"possible_keys": ["thread_id", "thread_id_2"],
"key": "thread_id_2",
"key_length": "6",
"used_key_parts": ["thread_id", "status"],
"ref": ["cscart_migrate.cscart_discussion.thread_id", "const"],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(cscart_discussion_posts.`status` = 'A')",
"using_index": true
},
"table": {
"table_name": "cscart_discussion_rating",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "thread_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["post_id"],
"ref": ["cscart_migrate.cscart_discussion_posts.post_id"],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(cscart_discussion_rating.thread_id = cscart_discussion.thread_id and cscart_discussion_rating.rating_value <> 0 and trigcond(cscart_discussion_posts.post_id is not null))"
}
}
}
Result
| product_id |
average_rating |
discussion_type |
discussion_thread_id |
| 63814 |
|
B |
89509 |
| 64276 |
|
B |
103187 |
| 64756 |
|
B |
144820 |
| 64757 |
|
B |
144850 |
| 64758 |
|
B |
144865 |
| 64759 |
|
B |
144875 |
| 64848 |
|
B |
148386 |
| 64944 |
|
B |
154901 |
| 65095 |
|
B |
162066 |
| 65099 |
|
B |
162885 |
| 65300 |
|
B |
170980 |