EXPLAIN\ SELECT table_a.id,\ table_a.appUserId,\ table_a.fecha,\ table_a.failed,\ table_a.successful,\ table_a.warning,\ table_a.statusId,\ table_a.sname,\ table_b.name AS source,\ table_c.iispecid,\ table_c.column_a,\ table_c.column_b,\ table_d.ispecid,\ table_c.column_c\ FROM table_a\ LEFT JOIN table_b ON (table_b.id = table_a.sourceId)\ LEFT JOIN table_c ON (table_a.id = table_c.ipid)\ LEFT JOIN table_d ON (table_a.id = table_d.ipid)\ ORDER BY fecha\ LIMIT 21 {\ "steps": [\ {\ "join_preparation": {\ "select#": 1,\ "steps": [\ {\ "expanded_query": "/* select#1 */ select `table_a`.`id` AS `id`,`table_a`.`appUserId` AS `appUserId`,`table_a`.`fecha` AS `fecha`,`table_a`.`failed` AS `failed`,`table_a`.`successful` AS `successful`,`table_a`.`warning` AS `warning`,`table_a`.`statusId` AS `statusId`,`table_a`.`sname` AS `sname`,`table_b`.`name` AS `source`,`table_c`.`iispecid` AS `iispecid`,`table_c`.`column_a` AS `column_a`,`table_c`.`column_b` AS `column_b`,`table_d`.`ispecid` AS `ispecid`,`table_c`.`column_c` AS `column_c` from (((`table_a` left join `table_b` on((`table_b`.`id` = `table_a`.`sourceId`))) left join `table_c` on((`table_a`.`id` = `table_c`.`ipid`))) left join `table_d` on((`table_a`.`id` = `table_d`.`ipid`))) order by `table_a`.`fecha` limit 21"\ },\ {\ "transformations_to_nested_joins": {\ "transformations": [\ "parenthesis_removal"\ ],\ "expanded_query": "/* select#1 */ select `table_a`.`id` AS `id`,`table_a`.`appUserId` AS `appUserId`,`table_a`.`fecha` AS `fecha`,`table_a`.`failed` AS `failed`,`table_a`.`successful` AS `successful`,`table_a`.`warning` AS `warning`,`table_a`.`statusId` AS `statusId`,`table_a`.`sname` AS `sname`,`table_b`.`name` AS `source`,`table_c`.`iispecid` AS `iispecid`,`table_c`.`column_a` AS `column_a`,`table_c`.`column_b` AS `column_b`,`table_d`.`ispecid` AS `ispecid`,`table_c`.`column_c` AS `column_c` from `table_a` left join `table_b` on((`table_b`.`id` = `table_a`.`sourceId`)) left join `table_c` on((`table_a`.`id` = `table_c`.`ipid`)) left join `table_d` on((`table_a`.`id` = `table_d`.`ipid`)) order by `table_a`.`fecha` limit 21"\ }\ }\ ]\ }\ },\ {\ "join_optimization": {\ "select#": 1,\ "steps": [\ {\ "condition_processing": {\ "condition": "WHERE",\ "original_condition": null,\ "steps": [\ {\ "transformation": "equality_propagation",\ "resulting_condition": null\ }\ ]\ }\ },\ {\ "substitute_generated_columns": {\ }\ },\ {\ "table_dependencies": [\ {\ "table": "`table_a`",\ "row_may_be_null": false,\ "map_bit": 0,\ "depends_on_map_bits": [\ ]\ },\ {\ "table": "`table_b`",\ "row_may_be_null": true,\ "map_bit": 1,\ "depends_on_map_bits": [\ 0\ ]\ },\ {\ "table": "`table_c`",\ "row_may_be_null": true,\ "map_bit": 2,\ "depends_on_map_bits": [\ 0,\ 1\ ]\ },\ {\ "table": "`table_d`",\ "row_may_be_null": true,\ "map_bit": 3,\ "depends_on_map_bits": [\ 0,\ 1,\ 2\ ]\ }\ ]\ },\ {\ "ref_optimizer_key_uses": [\ {\ "table": "`table_b`",\ "field": "id",\ "equals": "`table_a`.`sourceId`",\ "null_rejecting": true\ },\ {\ "table": "`table_c`",\ "field": "ipid",\ "equals": "`table_a`.`id`",\ "null_rejecting": false\ },\ {\ "table": "`table_d`",\ "field": "ipid",\ "equals": "`table_a`.`id`",\ "null_rejecting": false\ }\ ]\ },\ {\ "rows_estimation": [\ {\ "table": "`table_a`",\ "table_scan": {\ "rows": 1973233,\ "cost": 4378.8\ }\ },\ {\ "table": "`table_b`",\ "table_scan": {\ "rows": 8,\ "cost": 0.25\ }\ },\ {\ "table": "`table_c`",\ "table_scan": {\ "rows": 1990701,\ "cost": 1594\ }\ },\ {\ "table": "`table_d`",\ "table_scan": {\ "rows": 1,\ "cost": 0.25\ }\ }\ ]\ },\ {\ "considered_execution_plans": [\ {\ "plan_prefix": [\ ],\ "table": "`table_a`",\ "best_access_path": {\ "considered_access_paths": [\ {\ "rows_to_scan": 1973233,\ "access_type": "scan",\ "resulting_rows": 1.97e6,\ "cost": 201702,\ "chosen": true\ }\ ]\ },\ "condition_filtering_pct": 100,\ "rows_for_plan": 1.97e6,\ "cost_for_plan": 201702,\ "rest_of_plan": [\ {\ "plan_prefix": [\ "`table_a`"\ ],\ "table": "`table_b`",\ "best_access_path": {\ "considered_access_paths": [\ {\ "access_type": "eq_ref",\ "index": "PRIMARY",\ "rows": 1,\ "cost": 690632,\ "chosen": true,\ "cause": "clustered_pk_chosen_by_heuristics"\ },\ {\ "rows_to_scan": 8,\ "access_type": "scan",\ "using_join_cache": true,\ "buffers_needed": 7972,\ "resulting_rows": 8,\ "cost": 1.58e6,\ "chosen": false\ }\ ]\ },\ "condition_filtering_pct": 100,\ "rows_for_plan": 1.97e6,\ "cost_for_plan": 892334,\ "rest_of_plan": [\ {\ "plan_prefix": [\ "`table_a`",\ "`table_b`"\ ],\ "table": "`table_c`",\ "best_access_path": {\ "considered_access_paths": [\ {\ "access_type": "eq_ref",\ "index": "PRIMARY",\ "rows": 1,\ "cost": 690632,\ "chosen": true,\ "cause": "clustered_pk_chosen_by_heuristics"\ },\ {\ "rows_to_scan": 1990701,\ "access_type": "scan",\ "using_join_cache": true,\ "buffers_needed": 15710,\ "resulting_rows": 1.99e6,\ "cost": 3.9e11,\ "chosen": false\ }\ ]\ },\ "added_to_eq_ref_extension": true,\ "condition_filtering_pct": 100,\ "rows_for_plan": 1.97e6,\ "cost_for_plan": 1.58e6,\ "rest_of_plan": [\ {\ "plan_prefix": [\ "`table_a`",\ "`table_b`",\ "`table_c`"\ ],\ "table": "`table_d`",\ "best_access_path": {\ "considered_access_paths": [\ {\ "access_type": "eq_ref",\ "index": "PRIMARY",\ "rows": 1,\ "cost": 690632,\ "chosen": true,\ "cause": "clustered_pk_chosen_by_heuristics"\ },\ {\ "access_type": "scan",\ "chosen": false,\ "cause": "covering_index_better_than_full_scan"\ }\ ]\ },\ "added_to_eq_ref_extension": true,\ "condition_filtering_pct": 100,\ "rows_for_plan": 1.97e6,\ "cost_for_plan": 2.27e6,\ "chosen": true\ }\ ]\ }\ ]\ }\ ]\ }\ ]\ },\ {\ "condition_on_constant_tables": "true",\ "condition_value": true\ },\ {\ "attaching_conditions_to_tables": {\ "original_condition": "true",\ "attached_conditions_computation": [\ ],\ "attached_conditions_summary": [\ {\ "table": "`table_a`",\ "attached": null\ },\ {\ "table": "`table_b`",\ "attached": "(is_not_null_compl(table_b), (`table_b`.`id` = `table_a`.`sourceId`), true)"\ },\ {\ "table": "`table_c`",\ "attached": "(is_not_null_compl(table_c), (`table_c`.`ipid` = `table_a`.`id`), true)"\ },\ {\ "table": "`table_d`",\ "attached": "(is_not_null_compl(table_d), (`table_d`.`ipid` = `table_a`.`id`), true)"\ }\ ]\ }\ },\ {\ "optimizing_distinct_group_by_order_by": {\ "simplifying_order_by": {\ "original_clause": "`table_a`.`fecha`",\ "items": [\ {\ "item": "`table_a`.`fecha`"\ }\ ],\ "resulting_clause_is_simple": true,\ "resulting_clause": "`table_a`.`fecha`"\ }\ }\ },\ {\ "reconsidering_access_paths_for_index_ordering": {\ "clause": "ORDER BY",\ "steps": [\ ],\ "index_order_summary": {\ "table": "`table_a`",\ "index_provides_order": true,\ "order_direction": "asc",\ "index": "fecha",\ "plan_changed": true,\ "access_type": "index"\ }\ }\ },\ {\ "finalizing_table_conditions": [\ {\ "table": "`table_b`",\ "original_table_condition": "(is_not_null_compl(table_b), (`table_b`.`id` = `table_a`.`sourceId`), true)",\ "final_table_condition ": null\ },\ {\ "table": "`table_c`",\ "original_table_condition": "(is_not_null_compl(table_c), (`table_c`.`ipid` = `table_a`.`id`), true)",\ "final_table_condition ": null\ },\ {\ "table": "`table_d`",\ "original_table_condition": "(is_not_null_compl(table_d), (`table_d`.`ipid` = `table_a`.`id`), true)",\ "final_table_condition ": null\ }\ ]\ },\ {\ "refine_plan": [\ {\ "table": "`table_a`"\ },\ {\ "table": "`table_b`"\ },\ {\ "table": "`table_c`"\ },\ {\ "table": "`table_d`"\ }\ ]\ },\ {\ "considering_tmp_tables": [\ ]\ }\ ]\ }\ },\ {\ "join_explain": {\ "select#": 1,\ "steps": [\ ]\ }\ }\ ]\ } 0 0