Query time 0.00153
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "34.76"
},
"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": 30,
"rows_produced_per_join": 30,
"filtered": "100.00",
"index_condition": "((`nuie_scalesta_net`.`cscart_discussion`.`object_id` in (86778,82633,82634,83530,83531,85316,85413,85464,85515,86470,86746,86973,87034,89074,89820,89872,89944,91510,82851,82862,82924,82935,82997,83008,83444,83449,83513,83521,85123,84329)) and (`nuie_scalesta_net`.`cscart_discussion`.`object_type` = 'P'))",
"cost_info": {
"read_cost": "18.01",
"eval_cost": "3.00",
"prefix_cost": "21.01",
"data_read_per_join": "720"
},
"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_2",
"used_key_parts": [
"thread_id",
"status"
],
"key_length": "6",
"ref": [
"nuie_scalesta_net.cscart_discussion.thread_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 30,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "7.50",
"eval_cost": "3.00",
"prefix_cost": "31.51",
"data_read_per_join": "13K"
},
"used_columns": [
"post_id",
"thread_id",
"status"
]
}
},
{
"table": {
"table_name": "cscart_discussion_rating",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"thread_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 30,
"filtered": "100.00",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "0.25",
"eval_cost": "3.00",
"prefix_cost": "34.76",
"data_read_per_join": "480"
},
"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 |
| 82633 |
|
D |
90671 |
| 82634 |
|
D |
90672 |
| 82851 |
|
D |
90889 |
| 82862 |
|
D |
90900 |
| 82924 |
|
D |
90962 |
| 82935 |
|
D |
90973 |
| 82997 |
|
D |
91035 |
| 83008 |
|
D |
91046 |
| 83444 |
|
D |
91482 |
| 83449 |
|
D |
91487 |
| 83513 |
|
D |
91551 |
| 83521 |
|
D |
91559 |
| 83530 |
|
D |
91568 |
| 83531 |
|
D |
91569 |
| 84329 |
|
D |
92367 |
| 85123 |
|
D |
93161 |
| 85316 |
|
D |
93354 |
| 85413 |
|
D |
93451 |
| 85464 |
|
D |
93502 |
| 85515 |
|
D |
93553 |
| 86470 |
|
D |
94508 |
| 86746 |
|
D |
94784 |
| 86778 |
|
D |
94816 |
| 86973 |
|
D |
95011 |
| 87034 |
|
D |
95072 |
| 89074 |
|
D |
97112 |
| 89820 |
|
D |
97858 |
| 89872 |
|
D |
97910 |
| 89944 |
|
D |
97982 |
| 91510 |
|
D |
99583 |