Query time 0.00143
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 (100579,100580,100581,100582,100583,100584,100585,100586,100587,100588,100589,100590,100591,100592,100593,101047,101048,101049,101050,101051,101052,101053,101574,101575,101576,101577,101578,101579,101580,101581,101582,101583,101584,101585,101586,101587,101588,101589,101590,101591,101592,101593,101594,101595,101596,101597,101598,101599,101600,101601,101602,101603,101604,101605,101606,101607,101608,101609,101610,101611,101612,101613,101614,101615,101616,101617,101618,101619,101620,101621,101622,101623,101624)) 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 |
| 100579 |
|
B |
108759 |
| 100580 |
|
B |
108760 |
| 100581 |
|
B |
108761 |
| 100582 |
|
B |
108762 |
| 100583 |
|
B |
108763 |
| 100584 |
|
B |
108764 |
| 100585 |
|
B |
108765 |
| 100586 |
|
B |
108766 |
| 100587 |
|
B |
108767 |
| 100588 |
|
B |
108768 |
| 100589 |
|
B |
108769 |
| 100590 |
|
B |
108770 |
| 100591 |
|
B |
108771 |
| 100592 |
|
B |
108772 |
| 100593 |
|
B |
108773 |
| 101047 |
|
B |
109230 |
| 101048 |
|
B |
109231 |
| 101049 |
|
B |
109232 |
| 101050 |
|
B |
109233 |
| 101051 |
|
B |
109234 |
| 101052 |
|
B |
109235 |
| 101053 |
|
B |
109236 |
| 101574 |
|
B |
109757 |
| 101575 |
|
B |
109758 |
| 101576 |
|
B |
109759 |
| 101577 |
|
B |
109760 |
| 101578 |
|
B |
109761 |
| 101579 |
|
B |
109762 |
| 101580 |
|
B |
109763 |
| 101581 |
|
B |
109764 |
| 101582 |
|
B |
109765 |
| 101583 |
|
B |
109766 |
| 101584 |
|
B |
109767 |
| 101585 |
|
B |
109768 |
| 101586 |
|
B |
109769 |
| 101587 |
|
B |
109770 |
| 101588 |
|
B |
109771 |
| 101589 |
|
B |
109772 |
| 101590 |
|
B |
109773 |
| 101591 |
|
B |
109774 |
| 101592 |
|
B |
109775 |
| 101593 |
|
B |
109776 |
| 101594 |
|
B |
109777 |
| 101595 |
|
B |
109778 |
| 101596 |
|
B |
109779 |
| 101597 |
|
B |
109780 |
| 101598 |
|
B |
109781 |
| 101599 |
|
B |
109782 |
| 101600 |
|
B |
109783 |
| 101601 |
|
B |
109784 |
| 101602 |
|
B |
109785 |
| 101603 |
|
B |
109786 |
| 101604 |
|
B |
109787 |
| 101605 |
|
B |
109788 |
| 101606 |
|
B |
109789 |
| 101607 |
|
B |
109790 |
| 101608 |
|
B |
109791 |
| 101609 |
|
B |
109792 |
| 101610 |
|
B |
109793 |
| 101611 |
|
B |
109794 |
| 101612 |
|
B |
109795 |
| 101613 |
|
B |
109796 |
| 101614 |
|
B |
109797 |
| 101615 |
|
B |
109798 |
| 101616 |
|
B |
109799 |
| 101617 |
|
B |
109800 |
| 101618 |
|
B |
109801 |
| 101619 |
|
B |
109802 |
| 101620 |
|
B |
109803 |
| 101621 |
|
B |
109804 |
| 101622 |
|
B |
109805 |
| 101623 |
|
B |
109806 |
| 101624 |
|
B |
109807 |