Query time 0.00082
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 (58884,62123,29986,60914,29983,29992,29989,63034,62012,61430,62240,63755,62259,61340,61337,62252,61336,62253,62254,62260,64941,62258,64942,64943) 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 |
| 29983 |
5.0000 |
B |
249 |
| 29986 |
5.0000 |
B |
252 |
| 29989 |
5.0000 |
B |
49204 |
| 29992 |
4.0000 |
B |
258 |
| 58884 |
5.0000 |
B |
4037 |
| 60914 |
5.0000 |
B |
15601 |
| 61336 |
|
B |
17344 |
| 61337 |
5.0000 |
B |
17346 |
| 61340 |
4.7500 |
B |
17409 |
| 61430 |
|
B |
19704 |
| 62012 |
4.5000 |
B |
49211 |
| 62123 |
4.8333 |
B |
40880 |
| 62240 |
|
B |
45881 |
| 62252 |
5.0000 |
B |
47908 |
| 62253 |
|
B |
47919 |
| 62254 |
|
B |
47921 |
| 62258 |
|
B |
47937 |
| 62259 |
|
B |
47940 |
| 62260 |
|
B |
48133 |
| 63034 |
|
B |
68412 |
| 63755 |
|
B |
86296 |
| 64941 |
|
B |
154559 |
| 64942 |
|
B |
154576 |
| 64943 |
|
B |
154582 |