Query time 0.00141
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "50.86"
},
"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": 44,
"rows_produced_per_join": 44,
"filtered": "100.00",
"index_condition": "((`nuie_scalesta_net`.`cscart_discussion`.`object_id` in (84041,84044,84043,84040,88100,87866,84039,84042,88098,87831,87850,87829,87848,87865,87827,87846,93788,94367,94368,94369,94370,94371,96153,96174,96175,97953,97954,97955,97956,97957,97958,99026,99027,99028,99036,99037,99038,99048,99049,99320,99321,100413,100429,100430)) and (`nuie_scalesta_net`.`cscart_discussion`.`object_type` = 'P'))",
"cost_info": {
"read_cost": "26.41",
"eval_cost": "4.40",
"prefix_cost": "30.81",
"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": 44,
"filtered": "100.00",
"cost_info": {
"read_cost": "11.00",
"eval_cost": "4.40",
"prefix_cost": "46.21",
"data_read_per_join": "19K"
},
"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": 44,
"filtered": "100.00",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "0.25",
"eval_cost": "4.40",
"prefix_cost": "50.86",
"data_read_per_join": "704"
},
"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 |
| 84039 |
|
D |
92077 |
| 84040 |
|
D |
92078 |
| 84041 |
|
D |
92079 |
| 84042 |
|
D |
92080 |
| 84043 |
|
D |
92081 |
| 84044 |
|
D |
92082 |
| 87827 |
|
D |
95865 |
| 87829 |
|
D |
95867 |
| 87831 |
|
D |
95869 |
| 87846 |
|
D |
95884 |
| 87848 |
|
D |
95886 |
| 87850 |
|
D |
95888 |
| 87865 |
|
D |
95903 |
| 87866 |
|
D |
95904 |
| 88098 |
|
D |
96136 |
| 88100 |
|
D |
96138 |
| 93788 |
|
B |
101928 |
| 94367 |
|
B |
102509 |
| 94368 |
|
B |
102510 |
| 94369 |
|
B |
102511 |
| 94370 |
|
B |
102512 |
| 94371 |
|
B |
102513 |
| 96153 |
|
B |
104325 |
| 96174 |
|
B |
104346 |
| 96175 |
|
B |
104347 |
| 97953 |
|
B |
106134 |
| 97954 |
|
B |
106135 |
| 97955 |
|
B |
106136 |
| 97956 |
|
B |
106137 |
| 97957 |
|
B |
106138 |
| 97958 |
|
B |
106139 |
| 99026 |
|
B |
107207 |
| 99027 |
|
B |
107208 |
| 99028 |
|
B |
107209 |
| 99036 |
|
B |
107217 |
| 99037 |
|
B |
107218 |
| 99038 |
|
B |
107219 |
| 99048 |
|
B |
107229 |
| 99049 |
|
B |
107230 |
| 99320 |
|
B |
107501 |
| 99321 |
|
B |
107502 |
| 100413 |
|
B |
108593 |
| 100429 |
|
B |
108609 |
| 100430 |
|
B |
108610 |