Query time 0.00848
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "8.76"
},
"ordering_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "1.64"
},
"nested_loop": [
{
"table": {
"table_name": "jmj_banners",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"status"
],
"key": "status",
"used_key_parts": [
"status"
],
"key_length": "3",
"ref": [
"const"
],
"rows_examined_per_scan": 6,
"rows_produced_per_join": 1,
"filtered": "27.27",
"cost_info": {
"read_cost": "2.00",
"eval_cost": "0.33",
"prefix_cost": "3.20",
"data_read_per_join": "6K"
},
"used_columns": [
"banner_id",
"status",
"type",
"target",
"timestamp",
"abt__ut2_use_avail_period",
"abt__ut2_avail_from",
"abt__ut2_avail_till",
"abt__ut2_usergroup_ids",
"group_id"
],
"attached_condition": "((`jmj_test`.`jmj_banners`.`banner_id` in (25,26,27)) and (if((not((`jmj_test`.`jmj_banners`.`type` like 'abt__ut2'))),'available',if(((`jmj_test`.`jmj_banners`.`type` like 'abt__ut2') and ((`jmj_test`.`jmj_banners`.`abt__ut2_use_avail_period` = 'N') or ((`jmj_test`.`jmj_banners`.`abt__ut2_use_avail_period` = 'Y') and ((`jmj_test`.`jmj_banners`.`abt__ut2_avail_from` = 0) or (`jmj_test`.`jmj_banners`.`abt__ut2_avail_from` <= 1765697623)) and ((`jmj_test`.`jmj_banners`.`abt__ut2_avail_till` = 0) or (`jmj_test`.`jmj_banners`.`abt__ut2_avail_till` >= 1765697623))))),'available','not available')) = 'available') and ((`jmj_test`.`jmj_banners`.`abt__ut2_usergroup_ids` = '') or find_in_set(0,`jmj_test`.`jmj_banners`.`abt__ut2_usergroup_ids`) or find_in_set(1,`jmj_test`.`jmj_banners`.`abt__ut2_usergroup_ids`)))"
}
},
{
"table": {
"table_name": "jmj_banner_descriptions",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"banner_id",
"lang_code"
],
"key_length": "9",
"ref": [
"jmj_test.jmj_banners.banner_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.64",
"eval_cost": "0.33",
"prefix_cost": "5.16",
"data_read_per_join": "11K"
},
"used_columns": [
"banner_id",
"banner",
"url",
"description",
"lang_code"
]
}
},
{
"table": {
"table_name": "jmj_banner_images",
"access_type": "eq_ref",
"possible_keys": [
"banner"
],
"key": "banner",
"used_key_parts": [
"banner_id",
"lang_code"
],
"key_length": "9",
"ref": [
"jmj_test.jmj_banners.banner_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.64",
"eval_cost": "0.33",
"prefix_cost": "7.13",
"data_read_per_join": "26"
},
"used_columns": [
"banner_image_id",
"banner_id",
"lang_code"
],
"attached_condition": "<if>(found_match(jmj_banner_images), ((`jmj_test`.`jmj_banners`.`type` <> 'G') or (`jmj_test`.`jmj_banner_images`.`banner_image_id` is not null)), true)"
}
}
]
}
}
}
Result
| banner_id |
type |
target |
status |
timestamp |
banner |
description |
url |
banner_image_id |
group_id |
| 25 |
abt__ut2 |
B |
A |
1624386600 |
MAIN-1 |
|
|
240 |
0 |
| 26 |
abt__ut2 |
B |
A |
1624386600 |
MAIN-2 |
|
|
258 |
0 |
| 27 |
abt__ut2 |
B |
A |
1624386600 |
MAIN-3 |
|
|
260 |
0 |