Query time 0.00109
JSON explain
{
"query_block": {
"select_id": 1,
"filesort": {
"temporary_table": {
"function": "buffer",
"table": {
"table_name": "cscart_discussion",
"access_type": "ALL",
"possible_keys": ["object_id", "company_id"],
"rows": 41,
"filtered": 29.268,
"attached_condition": "((cscart_discussion.company_id = 1) and (cscart_discussion.object_id in (297,296,295,294,293,292,291,290,289,288,286,285)) and (cscart_discussion.object_type = 'P'))"
},
"block-nl-join": {
"table": {
"table_name": "cscart_discussion_posts",
"access_type": "ALL",
"possible_keys": ["thread_id", "thread_id_2"],
"rows": 2,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "256Kb",
"join_type": "BNL",
"attached_condition": "trigcond(((cscart_discussion_posts.thread_id = cscart_discussion.thread_id) and (cscart_discussion_posts.`status` = 'A')))"
},
"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": ["egkcysbp_cscartn.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 |
285 |
|
D |
37 |
286 |
|
D |
41 |
288 |
|
D |
43 |
289 |
|
D |
44 |
290 |
|
D |
46 |
291 |
|
D |
47 |
292 |
|
D |
48 |
293 |
|
D |
49 |
294 |
|
D |
50 |
295 |
|
D |
51 |
296 |
|
D |
53 |
297 |
|
D |
64 |