Query time 0.01118
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "10.65"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "0.17"
},
"nested_loop": [
{
"table": {
"table_name": "dp",
"access_type": "ALL",
"possible_keys": [
"thread_id",
"thread_id_2"
],
"rows_examined_per_scan": 25,
"rows_produced_per_join": 2,
"filtered": "10.00",
"cost_info": {
"read_cost": "6.78",
"eval_cost": "0.50",
"prefix_cost": "7.28",
"data_read_per_join": "1K"
},
"used_columns": [
"post_id",
"thread_id",
"status"
],
"attached_condition": "(`jmj_test`.`dp`.`status` = 'A')"
}
},
{
"table": {
"table_name": "jmj_discussion",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"object_id"
],
"key": "PRIMARY",
"used_key_parts": [
"thread_id"
],
"key_length": "3",
"ref": [
"jmj_test.dp.thread_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "6.71",
"cost_info": {
"read_cost": "2.50",
"eval_cost": "0.03",
"prefix_cost": "10.28",
"data_read_per_join": "4"
},
"used_columns": [
"thread_id",
"object_id",
"object_type"
],
"attached_condition": "((`jmj_test`.`jmj_discussion`.`object_id` in (1676,811,812,891,892,893,929,930,982,950,955,957,959,961,964,966,834,835,836,837,838,839,840,841,842,843,845,846,847,849,850,851,852,853,854,855,859,860,861,910,916,1531,1534,1439)) and (`jmj_test`.`jmj_discussion`.`object_type` = 'P'))"
}
},
{
"table": {
"table_name": "p",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"jmj_test.jmj_discussion.object_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "0.17",
"eval_cost": "0.03",
"prefix_cost": "10.48",
"data_read_per_join": "812"
},
"used_columns": [
"product_id"
]
}
}
]
}
}
}