{\ "steps": [\ {\ "join_preparation": {\ "select_id": 1,\ "steps": [\ {\ "expanded_query": "select count(0) AS `count(*)` from (t1 join t2 on(t1.a = t2.a and t1.b = t2.b and (t1.c = t2.c or t1.c is null and t2.c is null) and t1.d < t2.d))"\ }\ ]\ }\ },\ {\ "join_optimization": {\ "select_id": 1,\ "steps": [\ {\ "condition_processing": {\ "condition": "WHERE",\ "original_condition": "t1.a = t2.a and t1.b = t2.b and (t1.c = t2.c or t1.c is null and t2.c is null) and t1.d < t2.d",\ "steps": [\ {\ "transformation": "equality_propagation",\ "resulting_condition": "(multiple equal(t1.c, t2.c) or t1.c is null and t2.c is null) and t1.d < t2.d and multiple equal(t1.a, t2.a) and multiple equal(t1.b, t2.b)"\ },\ {\ "transformation": "constant_propagation",\ "resulting_condition": "(multiple equal(t1.c, t2.c) or t1.c is null and t2.c is null) and t1.d < t2.d and multiple equal(t1.a, t2.a) and multiple equal(t1.b, t2.b)"\ },\ {\ "transformation": "trivial_condition_removal",\ "resulting_condition": "(multiple equal(t1.c, t2.c) or t1.c is null and t2.c is null) and t1.d < t2.d and multiple equal(t1.a, t2.a) and multiple equal(t1.b, t2.b)"\ }\ ]\ }\ },\ {\ "ref_optimizer_key_uses": [\ {\ "table": "t1",\ "index": "t1_ix1",\ "field": "a",\ "equals": "t2.a",\ "null_rejecting": true\ },\ {\ "table": "t1",\ "index": "t1_ix1",\ "field": "b",\ "equals": "t2.b",\ "null_rejecting": true\ },\ {\ "table": "t1",\ "index": "t1_ix1",\ "field": "c",\ "equals": "t2.c",\ "null_rejecting": false\ },\ {\ "table": "t2",\ "index": "t2_ix1",\ "field": "a",\ "equals": "t1.a",\ "null_rejecting": true\ },\ {\ "table": "t2",\ "index": "t2_ix1",\ "field": "b",\ "equals": "t1.b",\ "null_rejecting": true\ }\ ]\ },\ {\ "rows_estimation": [\ {\ "selectivity_for_indexes": [],\ "selectivity_for_columns": [],\ "cond_selectivity": 1\ },\ {\ "table": "t1",\ "table_scan": {\ "rows": 1007765,\ "read_cost": 134.4112522,\ "read_and_compare_cost": 166.6597322\ }\ },\ {\ "selectivity_for_indexes": [],\ "selectivity_for_columns": [],\ "cond_selectivity": 1\ },\ {\ "table": "t2",\ "table_scan": {\ "rows": 997545,\ "read_cost": 133.0724322,\ "read_and_compare_cost": 164.9938722\ }\ }\ ]\ },\ {\ "table_dependencies": [\ {\ "table": "t1",\ "row_may_be_null": false,\ "map_bit": 0,\ "depends_on_map_bits": []\ },\ {\ "table": "t2",\ "row_may_be_null": false,\ "map_bit": 1,\ "depends_on_map_bits": []\ }\ ]\ },\ {\ "considered_execution_plans": [\ {\ "plan_prefix": "",\ "get_costs_for_tables": [\ {\ "best_access_path": {\ "table": "t2",\ "plan_details": {\ "record_count": 1\ },\ "considered_access_paths": [\ {\ "access_type": "scan",\ "rows": 997545,\ "rows_after_filter": 997545,\ "rows_out": 997545,\ "cost": 164.9938722,\ "index_only": false,\ "chosen": true\ }\ ],\ "chosen_access_method": {\ "type": "scan",\ "rows_read": 997545,\ "rows_out": 997545,\ "cost": 164.9938722,\ "uses_join_buffering": false\ }\ }\ },\ {\ "best_access_path": {\ "table": "t1",\ "plan_details": {\ "record_count": 1\ },\ "considered_access_paths": [\ {\ "access_type": "scan",\ "rows": 1007765,\ "rows_after_filter": 1007765,\ "rows_out": 1007765,\ "cost": 166.6597322,\ "index_only": false,\ "chosen": true\ }\ ],\ "chosen_access_method": {\ "type": "scan",\ "rows_read": 1007765,\ "rows_out": 1007765,\ "cost": 166.6597322,\ "uses_join_buffering": false\ }\ }\ }\ ]\ },\ {\ "plan_prefix": "",\ "table": "t2",\ "rows_for_plan": 997545,\ "cost_for_plan": 164.9938722,\ "rest_of_plan": [\ {\ "plan_prefix": "t2",\ "get_costs_for_tables": [\ {\ "best_access_path": {\ "table": "t1",\ "plan_details": {\ "record_count": 997545\ },\ "considered_access_paths": [\ {\ "access_type": "ref_or_null",\ "index": "t1_ix1",\ "rows": 2,\ "cost": 3599.566643,\ "chosen": true\ },\ {\ "access_type": "scan_with_join_cache",\ "rows": 1007765,\ "rows_after_filter": 1007765,\ "rows_out": 2,\ "cost": 93368095.52,\ "cost_without_join_buffer": 163971445.1,\ "index_only": false,\ "chosen": false\ }\ ],\ "chosen_access_method": {\ "type": "ref_or_null",\ "rows_read": 2,\ "rows_out": 2,\ "cost": 3599.566643,\ "uses_join_buffering": false\ }\ }\ }\ ]\ },\ {\ "plan_prefix": "t2",\ "table": "t1",\ "rows_for_plan": 1995090,\ "cost_for_plan": 3764.560515\ }\ ]\ },\ {\ "plan_prefix": "",\ "table": "t1",\ "rows_for_plan": 1007765,\ "cost_for_plan": 166.6597322,\ "rest_of_plan": [\ {\ "plan_prefix": "t1",\ "get_costs_for_tables": [\ {\ "best_access_path": {\ "table": "t2",\ "plan_details": {\ "record_count": 1007765\ },\ "considered_access_paths": [\ {\ "access_type": "ref",\ "index": "t2_ix1",\ "used_range_estimates": false,\ "reason": "not available",\ "rows": 1,\ "cost": 1837.642432,\ "chosen": true\ },\ {\ "access_type": "scan_with_join_cache",\ "rows": 997545,\ "rows_after_filter": 997545,\ "rows_out": 1,\ "cost": 93368150.57,\ "cost_without_join_buffer": 163972562,\ "index_only": false,\ "chosen": false\ }\ ],\ "chosen_access_method": {\ "type": "ref",\ "index": "t2_ix1",\ "rows_read": 1,\ "rows_out": 1,\ "cost": 1837.642432,\ "uses_join_buffering": false\ }\ }\ }\ ]\ },\ {\ "plan_prefix": "t1",\ "table": "t2",\ "rows_for_plan": 1007765,\ "cost_for_plan": 2004.302164\ }\ ]\ }\ ]\ },\ {\ "best_join_order": ["t1", "t2"],\ "rows": 1007765,\ "cost": 2004.302164\ },\ {\ "substitute_best_equal": {\ "condition": "WHERE",\ "resulting_condition": "t2.a = t1.a and t2.b = t1.b and (t2.c = t1.c or t1.c is null and t2.c is null) and t1.d < t2.d"\ }\ },\ {\ "attaching_conditions_to_tables": {\ "attached_conditions_computation": [],\ "attached_conditions_summary": [\ {\ "table": "t1",\ "attached_condition": "t1.a is not null and t1.b is not null"\ },\ {\ "table": "t2",\ "attached_condition": "(t2.c = t1.c or t1.c is null and t2.c is null) and t1.d < t2.d"\ }\ ]\ }\ },\ {\ "make_join_readinfo": []\ },\ {\ "prepare_sum_aggregators": {\ "function": "count(0)",\ "aggregator_type": "simple"\ }\ }\ ]\ }\ },\ {\ "join_execution": {\ "select_id": 1,\ "steps": []\ }\ }\ ]\ }