Query time 0.00061
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "84.21"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_discussion",
"access_type": "range",
"possible_keys": [
"object_id"
],
"key": "object_id",
"used_key_parts": [
"object_id",
"object_type"
],
"key_length": "6",
"rows_examined_per_scan": 73,
"rows_produced_per_join": 73,
"filtered": "100.00",
"index_condition": "((`nuie_scalesta_net`.`cscart_discussion`.`object_id` in (101115,101121,101122,101123,101124,101130,101131,101132,101133,101514,101515,101516,101517,101523,101524,101525,101526,101532,101533,101534,101535,101552,101553,101554,101555,101561,101562,101563,101564,101570,101571,101572,101573,101814,101815,101816,101817,101818,101819,101820,101821,101822,101823,101824,101825,101826,101827,101828,101829,101830,101831,101832,101833,101834,101835,101836,101837,101838,101839,101840,101841,101842,101843,101844,101845,101846,101847,101848,101849,101850,101851,101852,101853)) and (`nuie_scalesta_net`.`cscart_discussion`.`object_type` = 'P'))",
"cost_info": {
"read_cost": "43.81",
"eval_cost": "7.30",
"prefix_cost": "51.11",
"data_read_per_join": "1K"
},
"used_columns": [
"thread_id",
"object_id",
"object_type",
"type"
]
}
},
{
"table": {
"table_name": "cscart_discussion_posts",
"access_type": "ref",
"possible_keys": [
"thread_id",
"thread_id_2"
],
"key": "thread_id",
"used_key_parts": [
"thread_id"
],
"key_length": "3",
"ref": [
"nuie_scalesta_net.cscart_discussion.thread_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 73,
"filtered": "100.00",
"cost_info": {
"read_cost": "18.25",
"eval_cost": "7.30",
"prefix_cost": "76.66",
"data_read_per_join": "31K"
},
"used_columns": [
"post_id",
"thread_id",
"status"
],
"attached_condition": "<if>(is_not_null_compl(cscart_discussion_posts), (`nuie_scalesta_net`.`cscart_discussion_posts`.`status` = 'A'), true)"
}
},
{
"table": {
"table_name": "cscart_discussion_rating",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"thread_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 73,
"filtered": "100.00",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "0.25",
"eval_cost": "7.30",
"prefix_cost": "84.21",
"data_read_per_join": "1K"
},
"used_columns": [
"rating_value",
"post_id",
"thread_id"
],
"attached_condition": "<if>(is_not_null_compl(cscart_discussion_rating), ((`nuie_scalesta_net`.`cscart_discussion_rating`.`post_id` = `nuie_scalesta_net`.`cscart_discussion_posts`.`post_id`) and (`nuie_scalesta_net`.`cscart_discussion_rating`.`thread_id` = `nuie_scalesta_net`.`cscart_discussion`.`thread_id`) and (`nuie_scalesta_net`.`cscart_discussion_rating`.`rating_value` <> 0)), true)"
}
}
]
}
}
}
Result
| product_id |
average_rating |
discussion_type |
discussion_thread_id |
| 101115 |
|
B |
109298 |
| 101121 |
|
B |
109304 |
| 101122 |
|
B |
109305 |
| 101123 |
|
B |
109306 |
| 101124 |
|
B |
109307 |
| 101130 |
|
B |
109313 |
| 101131 |
|
B |
109314 |
| 101132 |
|
B |
109315 |
| 101133 |
|
B |
109316 |
| 101514 |
|
B |
109697 |
| 101515 |
|
B |
109698 |
| 101516 |
|
B |
109699 |
| 101517 |
|
B |
109700 |
| 101523 |
|
B |
109706 |
| 101524 |
|
B |
109707 |
| 101525 |
|
B |
109708 |
| 101526 |
|
B |
109709 |
| 101532 |
|
B |
109715 |
| 101533 |
|
B |
109716 |
| 101534 |
|
B |
109717 |
| 101535 |
|
B |
109718 |
| 101552 |
|
B |
109735 |
| 101553 |
|
B |
109736 |
| 101554 |
|
B |
109737 |
| 101555 |
|
B |
109738 |
| 101561 |
|
B |
109744 |
| 101562 |
|
B |
109745 |
| 101563 |
|
B |
109746 |
| 101564 |
|
B |
109747 |
| 101570 |
|
B |
109753 |
| 101571 |
|
B |
109754 |
| 101572 |
|
B |
109755 |
| 101573 |
|
B |
109756 |
| 101814 |
|
B |
109997 |
| 101815 |
|
B |
109998 |
| 101816 |
|
B |
109999 |
| 101817 |
|
B |
110000 |
| 101818 |
|
B |
110001 |
| 101819 |
|
B |
110002 |
| 101820 |
|
B |
110003 |
| 101821 |
|
B |
110004 |
| 101822 |
|
B |
110005 |
| 101823 |
|
B |
110006 |
| 101824 |
|
B |
110007 |
| 101825 |
|
B |
110008 |
| 101826 |
|
B |
110009 |
| 101827 |
|
B |
110010 |
| 101828 |
|
B |
110011 |
| 101829 |
|
B |
110012 |
| 101830 |
|
B |
110013 |
| 101831 |
|
B |
110014 |
| 101832 |
|
B |
110015 |
| 101833 |
|
B |
110016 |
| 101834 |
|
B |
110017 |
| 101835 |
|
B |
110018 |
| 101836 |
|
B |
110019 |
| 101837 |
|
B |
110020 |
| 101838 |
|
B |
110021 |
| 101839 |
|
B |
110022 |
| 101840 |
|
B |
110023 |
| 101841 |
|
B |
110024 |
| 101842 |
|
B |
110025 |
| 101843 |
|
B |
110026 |
| 101844 |
|
B |
110027 |
| 101845 |
|
B |
110028 |
| 101846 |
|
B |
110029 |
| 101847 |
|
B |
110030 |
| 101848 |
|
B |
110031 |
| 101849 |
|
B |
110032 |
| 101850 |
|
B |
110033 |
| 101851 |
|
B |
110034 |
| 101852 |
|
B |
110035 |
| 101853 |
|
B |
110036 |