Query time 0.00039
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "12.96"
},
"nested_loop": [
{
"table": {
"table_name": "ab__dotd",
"access_type": "ALL",
"possible_keys": [
"PRIMARY"
],
"rows_examined_per_scan": 69,
"rows_produced_per_join": 6,
"filtered": "10.00",
"cost_info": {
"read_cost": "6.96",
"eval_cost": "0.69",
"prefix_cost": "7.65",
"data_read_per_join": "276"
},
"used_columns": [
"promotion_id",
"use_schedule"
],
"attached_condition": "(`kcoffee`.`ab__dotd`.`use_schedule` = 'Y')"
}
},
{
"table": {
"table_name": "p",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"promotion_id"
],
"key_length": "3",
"ref": [
"kcoffee.ab__dotd.promotion_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "20.00",
"cost_info": {
"read_cost": "1.73",
"eval_cost": "0.14",
"prefix_cost": "10.07",
"data_read_per_join": "1K"
},
"used_columns": [
"promotion_id",
"to_date",
"from_date",
"status"
],
"attached_condition": "(`kcoffee`.`p`.`status` in ('A','H'))"
}
},
{
"table": {
"table_name": "active",
"access_type": "ref",
"possible_keys": [
"<auto_key0>"
],
"key": "<auto_key0>",
"used_key_parts": [
"promotion_id"
],
"key_length": "3",
"ref": [
"kcoffee.ab__dotd.promotion_id"
],
"rows_examined_per_scan": 2,
"rows_produced_per_join": 2,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.69",
"eval_cost": "0.28",
"prefix_cost": "11.03",
"data_read_per_join": "66"
},
"used_columns": [
"promotion_id",
"from_date",
"to_date"
],
"materialized_from_subquery": {
"using_temporary_table": true,
"dependent": false,
"cacheable": true,
"query_block": {
"select_id": 2,
"cost_info": {
"query_cost": "1.55"
},
"grouping_operation": {
"using_filesort": false,
"table": {
"table_name": "cscart_ab__dotd_periods",
"access_type": "index",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"promotion_id",
"from_date"
],
"key_length": "7",
"rows_examined_per_scan": 13,
"rows_produced_per_join": 4,
"filtered": "33.33",
"cost_info": {
"read_cost": "1.12",
"eval_cost": "0.43",
"prefix_cost": "1.55",
"data_read_per_join": "69"
},
"used_columns": [
"promotion_id",
"from_date",
"to_date"
],
"attached_condition": "(`kcoffee`.`cscart_ab__dotd_periods`.`to_date` >= 1789973818)"
}
}
}
}
}
},
{
"table": {
"table_name": "expired",
"access_type": "ref",
"possible_keys": [
"<auto_key0>"
],
"key": "<auto_key0>",
"used_key_parts": [
"promotion_id"
],
"key_length": "3",
"ref": [
"kcoffee.ab__dotd.promotion_id"
],
"rows_examined_per_scan": 2,
"rows_produced_per_join": 5,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.38",
"eval_cost": "0.55",
"prefix_cost": "12.96",
"data_read_per_join": "132"
},
"used_columns": [
"promotion_id",
"from_date",
"to_date"
],
"materialized_from_subquery": {
"using_temporary_table": true,
"dependent": false,
"cacheable": true,
"query_block": {
"select_id": 3,
"cost_info": {
"query_cost": "1.55"
},
"grouping_operation": {
"using_filesort": false,
"table": {
"table_name": "cscart_ab__dotd_periods",
"access_type": "index",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"promotion_id",
"from_date"
],
"key_length": "7",
"rows_examined_per_scan": 13,
"rows_produced_per_join": 4,
"filtered": "33.33",
"cost_info": {
"read_cost": "1.12",
"eval_cost": "0.43",
"prefix_cost": "1.55",
"data_read_per_join": "69"
},
"used_columns": [
"promotion_id",
"from_date",
"to_date"
],
"attached_condition": "(`kcoffee`.`cscart_ab__dotd_periods`.`to_date` < 1789973818)"
}
}
}
}
}
}
]
}
}