Query time 0.00078
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": 24,
"filtered": 100,
"index_condition": "cscart_discussion.object_id in (62163,62981,62983,65067,60825,60798,60800,62018,64944,64783,64866,60813,64753,64901,65099,64795,65095,64759,64874,64791,64867,64907,64868,64824) 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 |
| 60798 |
|
B |
15712 |
| 60800 |
|
B |
15716 |
| 60813 |
5.0000 |
B |
15684 |
| 60825 |
|
B |
15714 |
| 62018 |
5.0000 |
B |
47198 |
| 62163 |
|
B |
41888 |
| 62981 |
|
B |
66835 |
| 62983 |
|
B |
66856 |
| 64753 |
5.0000 |
B |
144638 |
| 64759 |
|
B |
144875 |
| 64783 |
|
B |
146311 |
| 64791 |
|
B |
146647 |
| 64795 |
|
B |
146679 |
| 64824 |
|
B |
147484 |
| 64866 |
5.0000 |
B |
150815 |
| 64867 |
|
B |
150823 |
| 64868 |
|
B |
150837 |
| 64874 |
|
B |
151995 |
| 64901 |
|
B |
152161 |
| 64907 |
|
B |
152199 |
| 64944 |
|
B |
154901 |
| 65067 |
5.0000 |
B |
160763 |
| 65095 |
|
B |
162066 |
| 65099 |
|
B |
162885 |