Query time 0.00062
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 (60749,60748,60739,60745,60753,60746,60736,60731,60726,60750,60734,61388,60741,60747,60730,60740,61387,60742,61171,60732,60733,60737,61385,60751) 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 |
| 60726 |
|
B |
16386 |
| 60730 |
|
B |
16372 |
| 60731 |
5.0000 |
B |
16391 |
| 60732 |
|
B |
16392 |
| 60733 |
|
B |
16378 |
| 60734 |
|
B |
16375 |
| 60736 |
|
B |
16379 |
| 60737 |
|
B |
16373 |
| 60739 |
5.0000 |
B |
16381 |
| 60740 |
|
B |
16382 |
| 60741 |
|
B |
16383 |
| 60742 |
|
B |
16387 |
| 60745 |
|
B |
16384 |
| 60746 |
|
B |
16389 |
| 60747 |
|
B |
16390 |
| 60748 |
|
B |
16371 |
| 60749 |
4.0000 |
B |
16380 |
| 60750 |
5.0000 |
B |
16377 |
| 60751 |
|
B |
25823 |
| 60753 |
|
B |
16385 |
| 61171 |
|
B |
16678 |
| 61385 |
|
B |
18007 |
| 61387 |
|
B |
18014 |
| 61388 |
|
B |
18019 |