Query time 0.00118
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "55.46"
},
"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": 48,
"rows_produced_per_join": 48,
"filtered": "100.00",
"index_condition": "((`nuie_scalesta_net`.`cscart_discussion`.`object_id` in (90569,90574,90575,91090,91091,91094,91095,91097,91098,91099,91176,91177,91180,91181,91183,91184,91185,91231,91232,91235,91236,91238,91239,91240,83268,83270,90544,90545,91070,91071,91073,91074,91075,90567,90573,90579,87308,87309,87320,87321,87332,87333,87344,87345,90555,90582,90855,90934)) and (`nuie_scalesta_net`.`cscart_discussion`.`object_type` = 'P'))",
"cost_info": {
"read_cost": "28.81",
"eval_cost": "4.80",
"prefix_cost": "33.61",
"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": 48,
"filtered": "100.00",
"cost_info": {
"read_cost": "12.00",
"eval_cost": "4.80",
"prefix_cost": "50.41",
"data_read_per_join": "21K"
},
"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": 48,
"filtered": "100.00",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "0.25",
"eval_cost": "4.80",
"prefix_cost": "55.46",
"data_read_per_join": "768"
},
"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 |
| 83268 |
|
D |
91306 |
| 83270 |
|
D |
91308 |
| 87308 |
|
D |
95346 |
| 87309 |
|
D |
95347 |
| 87320 |
|
D |
95358 |
| 87321 |
|
D |
95359 |
| 87332 |
|
D |
95370 |
| 87333 |
|
D |
95371 |
| 87344 |
|
D |
95382 |
| 87345 |
|
D |
95383 |
| 90544 |
|
D |
98596 |
| 90545 |
|
D |
98597 |
| 90555 |
|
D |
98607 |
| 90567 |
|
D |
98619 |
| 90569 |
|
D |
98621 |
| 90573 |
|
D |
98625 |
| 90574 |
|
D |
98626 |
| 90575 |
|
D |
98627 |
| 90579 |
|
D |
98631 |
| 90582 |
|
D |
98634 |
| 90855 |
|
D |
98928 |
| 90934 |
|
D |
99007 |
| 91070 |
|
D |
99143 |
| 91071 |
|
D |
99144 |
| 91073 |
|
D |
99146 |
| 91074 |
|
D |
99147 |
| 91075 |
|
D |
99148 |
| 91090 |
|
D |
99163 |
| 91091 |
|
D |
99164 |
| 91094 |
|
D |
99167 |
| 91095 |
|
D |
99168 |
| 91097 |
|
D |
99170 |
| 91098 |
|
D |
99171 |
| 91099 |
|
D |
99172 |
| 91176 |
|
D |
99249 |
| 91177 |
|
D |
99250 |
| 91180 |
|
D |
99253 |
| 91181 |
|
D |
99254 |
| 91183 |
|
D |
99256 |
| 91184 |
|
D |
99257 |
| 91185 |
|
D |
99258 |
| 91231 |
|
D |
99304 |
| 91232 |
|
D |
99305 |
| 91235 |
|
D |
99308 |
| 91236 |
|
D |
99309 |
| 91238 |
|
D |
99311 |
| 91239 |
|
D |
99312 |
| 91240 |
|
D |
99313 |