{
  "steps": [
    {
      "join_preparation": {
        "select_id": 1,
        "steps": [
          {
            "expanded_query": "select a.reference_number AS reference_number,b.validation_date AS validation_date from (table_a a left join table_b b on(a.id = b.fk_id)) limit 1"
          }
        ]
      }
    },
    {
      "join_optimization": {
        "select_id": 1,
        "steps": [
          {
            "build_equal_items": {
              "condition": "ON expr",
              "attached_to": "b",
              "resulting_condition": "multiple equal(a.id, b.fk_id)"
            }
          },
          {
            "ref_optimizer_key_uses": [
              {
                "table": "b",
                "index": "idx_fk",
                "field": "fk_id",
                "equals": "a.id",
                "null_rejecting": true
              }
            ]
          },
          {
            "eliminated_tables": []
          },
          {
            "rows_estimation": [
              {
                "table": "a",
                "table_scan": {
                  "rows": 25717,
                  "read_cost": 3.7900858,
                  "read_and_compare_cost": 4.6130298
                }
              },
              {
                "table": "b",
                "table_scan": {
                  "rows": 108984,
                  "read_cost": 14.5886484,
                  "read_and_compare_cost": 18.0761364
                }
              }
            ]
          },
          {
            "table_dependencies": [
              {
                "table": "a",
                "row_may_be_null": false,
                "map_bit": 0,
                "depends_on_map_bits": []
              },
              {
                "table": "b",
                "row_may_be_null": true,
                "map_bit": 1,
                "depends_on_map_bits": [
                  "0"
                ]
              }
            ]
          },
          {
            "considered_execution_plans": [
              {
                "plan_prefix": "",
                "get_costs_for_tables": [
                  {
                    "best_access_path": {
                      "table": "a",
                      "plan_details": {
                        "record_count": 1
                      },
                      "considered_access_paths": [
                        {
                          "access_type": "scan",
                          "rows": 25717,
                          "rows_after_filter": 25717,
                          "rows_out": 25717,
                          "cost": 4.6130298,
                          "index_only": false,
                          "chosen": true
                        }
                      ],
                      "chosen_access_method": {
                        "type": "scan",
                        "rows_read": 25717,
                        "rows_out": 25717,
                        "cost": 4.6130298,
                        "uses_join_buffering": false
                      }
                    }
                  }
                ]
              },
              {
                "plan_prefix": "",
                "table": "a",
                "rows_for_plan": 25717,
                "cost_for_plan": 4.6130298,
                "rest_of_plan": [
                  {
                    "plan_prefix": "a",
                    "get_costs_for_tables": [
                      {
                        "best_access_path": {
                          "table": "b",
                          "plan_details": {
                            "record_count": 25717
                          },
                          "considered_access_paths": [
                            {
                              "access_type": "ref",
                              "index": "idx_fk",
                              "rows": 108984,
                              "cost": 2784449.486,
                              "chosen": true
                            },
                            {
                              "access_type": "scan",
                              "rows": 108984,
                              "rows_after_filter": 108984,
                              "rows_out": 81738,
                              "cost": 457427.5086,
                              "index_only": false,
                              "chosen": true
                            }
                          ],
                          "chosen_access_method": {
                            "type": "scan",
                            "rows_read": 108984,
                            "rows_out": 81738,
                            "cost": 457427.5086,
                            "uses_join_buffering": true
                          }
                        }
                      }
                    ]
                  },
                  {
                    "plan_prefix": "a",
                    "table": "b",
                    "rows_for_plan": 2102056146,
                    "cost_for_plan": 457432.1217,
                    "pushdown_cond_selectivity": 0.75,
                    "filtered": 75,
                    "rows_out": 81738
                  }
                ]
              }
            ]
          },
          {
            "best_join_order": [
              "a",
              "b"
            ],
            "rows": 2102056146,
            "cost": 457432.1217
          },
          {
            "substitute_best_equal": {
              "condition": "WHERE",
              "resulting_condition": "1"
            }
          },
          {
            "substitute_best_equal": {
              "condition": "ON expr",
              "attached_to": "b",
              "resulting_condition": "b.fk_id = a.id"
            }
          },
          {
            "attaching_conditions_to_tables": {
              "attached_conditions_computation": [
                {
                  "condition_on_constant_tables": "1",
                  "computing_condition": []
                },
                {
                  "table": "b",
                  "range_analysis": {
                    "table_scan": {
                      "rows": 108984,
                      "cost": 18.0761364
                    },
                    "potential_range_indexes": [
                      {
                        "index": "PRIMARY",
                        "usable": false,
                        "cause": "not applicable"
                      },
                      {
                        "index": "idx_fk",
                        "usable": true,
                        "key_parts": [
                          "fk_id",
                          "id_validation"
                        ]
                      }
                    ],
                    "setup_range_conditions": [],
                    "analyzing_range_alternatives": {
                      "range_scan_alternatives": [
                        {
                          "index": "idx_fk"
                        }
                      ],
                      "analyzing_roworder_intersect": {
                        "cause": "too few roworder scans"
                      },
                      "analyzing_index_merge_union": []
                    },
                    "group_index_range": {
                      "chosen": false,
                      "cause": "not single_table"
                    }
                  }
                }
              ],
              "attached_conditions_summary": [
                {
                  "table": "a",
                  "attached_condition": null
                },
                {
                  "table": "b",
                  "attached_condition": "trigcond(b.fk_id = a.id)"
                }
              ]
            }
          },
          {
            "make_join_readinfo": []
          }
        ]
      }
    }
  ]
}
