+-------------------------------------------------+
| section                                         |
+-------------------------------------------------+
| === Environment: optimizer-related settings === |
+-------------------------------------------------+
+-----------------+
| mariadb_version |
+-----------------+
| 12.3.2-MariaDB  |
+-----------------+
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Variable_name                   | Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| histogram_size                  | 254                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| histogram_type                  | JSON_HB                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| join_buffer_size                | 262144                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| join_buffer_space_limit         | 2097152                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| join_cache_level                | 2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| max_heap_table_size             | 16777216                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| optimizer_join_limit_pref_ratio | 0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| optimizer_prune_level           | 2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| optimizer_search_depth          | 62                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| optimizer_switch                | index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,duplicateweedout=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on,cset_narrowing=on,sargable_casefold=on,reorder_outer_joins=off |
| optimizer_trace                 | enabled=off                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| optimizer_trace_max_mem_size    | 1048576                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| sort_buffer_size                | 2097152                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| tmp_table_size                  | 16777216                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| use_stat_tables                 | PREFERABLY_FOR_QUERIES                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+-----------------------------------------------------------+
| section                                                   |
+-----------------------------------------------------------+
| === Data profile: empty final join, huge t2-t3 fanout === |
+-----------------------------------------------------------+
+------------+------------+--------+---------+---------+
| table_name | rows_total | ndv_c0 | min_c0  | max_c0  |
+------------+------------+--------+---------+---------+
| t1         |       2000 |    500 | 1000000 | 1000499 |
| t2         |      10000 |      5 |       0 |       4 |
| t3         |       5000 |      5 |       0 |       4 |
+------------+------------+--------+---------+---------+
+-----------------------------+
| theoretical_t2_t3_join_rows |
+-----------------------------+
|                    10000000 |
+-----------------------------+
+-----------------------------+
| theoretical_t2_t1_join_rows |
+-----------------------------+
|                           0 |
+-----------------------------+
+-----------------------------+
| theoretical_t3_t1_join_rows |
+-----------------------------+
|                           0 |
+-----------------------------+
+----------------------------+
| final_distinct_result_rows |
+----------------------------+
|                          0 |
+----------------------------+
+-------------------------------+
| section                       |
+-------------------------------+
| === Statistics collection === |
+-------------------------------+
+--------------------------------+---------+----------+----------+
| Table                          | Op      | Msg_type | Msg_text |
+--------------------------------+---------+----------+----------+
| mariadb_prune0_cost_misrank.t1 | analyze | status   | OK       |
| mariadb_prune0_cost_misrank.t2 | analyze | status   | OK       |
| mariadb_prune0_cost_misrank.t3 | analyze | status   | OK       |
+--------------------------------+---------+----------+----------+
+--------------------------------+---------+----------+-----------------------------------------+
| Table                          | Op      | Msg_type | Msg_text                                |
+--------------------------------+---------+----------+-----------------------------------------+
| mariadb_prune0_cost_misrank.t1 | analyze | status   | Engine-independent statistics collected |
| mariadb_prune0_cost_misrank.t1 | analyze | status   | OK                                      |
+--------------------------------+---------+----------+-----------------------------------------+
+--------------------------------+---------+----------+-----------------------------------------+
| Table                          | Op      | Msg_type | Msg_text                                |
+--------------------------------+---------+----------+-----------------------------------------+
| mariadb_prune0_cost_misrank.t2 | analyze | status   | Engine-independent statistics collected |
| mariadb_prune0_cost_misrank.t2 | analyze | status   | OK                                      |
+--------------------------------+---------+----------+-----------------------------------------+
+--------------------------------+---------+----------+-----------------------------------------+
| Table                          | Op      | Msg_type | Msg_text                                |
+--------------------------------+---------+----------+-----------------------------------------+
| mariadb_prune0_cost_misrank.t3 | analyze | status   | Engine-independent statistics collected |
| mariadb_prune0_cost_misrank.t3 | analyze | status   | OK                                      |
+--------------------------------+---------+----------+-----------------------------------------+
+----------------------------------------------------------------------------+
| section                                                                    |
+----------------------------------------------------------------------------+
| === Core reproduction: prune=0, base plan vs forced early-reject plans === |
+----------------------------------------------------------------------------+
+--------------------------------------------------------------------------------------------+
| note                                                                                       |
+--------------------------------------------------------------------------------------------+
| Expected bad shape: base chooses t3 -> t2 -> t1; t1 is probed after the huge t2-t3 fanout. |
+--------------------------------------------------------------------------------------------+
+----------------------------------------------+
| probe                                        |
+----------------------------------------------+
| A/base EXPLAIN under optimizer_prune_level=0 |
+----------------------------------------------+
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| EXPLAIN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| {
  "query_block": {
    "select_id": 1,
    "cost": 18780.77009,
    "filesort": {
      "sort_key": "t3.c2 desc",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "t3",
              "access_type": "ALL",
              "possible_keys": ["i6", "i7"],
              "loops": 1,
              "rows": 5000,
              "cost": 0.8403864,
              "filtered": 100
            }
          },
          {
            "block-nl-join": {
              "table": {
                "table_name": "t2",
                "access_type": "ALL",
                "possible_keys": ["i4"],
                "loops": 5000,
                "rows": 10000,
                "cost": 4645.327246,
                "filtered": 20
              },
              "buffer_type": "flat",
              "buffer_size": "92KiB",
              "join_type": "BNL",
              "attached_condition": "t2.c0 = t3.c0"
            }
          },
          {
            "table": {
              "table_name": "t1",
              "access_type": "ref",
              "possible_keys": ["i2", "i3"],
              "key": "i2",
              "key_length": "8",
              "used_key_parts": ["c0"],
              "ref": ["mariadb_prune0_cost_misrank.t3.c0"],
              "loops": 10000000,
              "rows": 4,
              "cost": 14134.60246,
              "filtered": 100,
              "using_index": true,
              "distinct": true
            }
          }
        ]
      }
    }
  }
} |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+----------------------------------------------+
| probe                                        |
+----------------------------------------------+
| B/base ANALYZE under optimizer_prune_level=0 |
+----------------------------------------------+
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ANALYZE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| {
  "query_optimization": {
    "r_total_time_ms": 0.081906447
  },
  "query_block": {
    "select_id": 1,
    "cost": 18780.77009,
    "r_loops": 1,
    "r_total_time_ms": 11531.47646,
    "filesort": {
      "sort_key": "t3.c2 desc",
      "r_loops": 1,
      "r_total_time_ms": 0.005949243,
      "r_limit": 8,
      "r_used_priority_queue": true,
      "r_output_rows": 0,
      "r_sort_mode": "sort_key,rowid",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "t3",
              "access_type": "ALL",
              "possible_keys": ["i6", "i7"],
              "loops": 1,
              "r_loops": 1,
              "rows": 5000,
              "r_rows": 5000,
              "cost": 0.8403864,
              "r_table_time_ms": 1.351693875,
              "r_other_time_ms": 0.380163274,
              "r_engine_stats": {
                "pages_accessed": 18
              },
              "filtered": 100,
              "r_total_filtered": 100,
              "r_filtered": 100
            }
          },
          {
            "block-nl-join": {
              "table": {
                "table_name": "t2",
                "access_type": "ALL",
                "possible_keys": ["i4"],
                "loops": 5000,
                "r_loops": 1,
                "rows": 10000,
                "r_rows": 10000,
                "cost": 4645.327246,
                "r_table_time_ms": 5.988036511,
                "r_other_time_ms": 0.524509823,
                "r_engine_stats": {
                  "pages_accessed": 52
                },
                "filtered": 20,
                "r_total_filtered": 100,
                "r_filtered": 100
              },
              "buffer_type": "flat",
              "buffer_size": "92KiB",
              "join_type": "BNL",
              "attached_condition": "t2.c0 = t3.c0",
              "r_loops": 5000,
              "r_filtered": 20,
              "r_unpack_time_ms": 2042.480158,
              "r_other_time_ms": 2581.993031,
              "r_effective_rows": 10000
            }
          },
          {
            "table": {
              "table_name": "t1",
              "access_type": "ref",
              "possible_keys": ["i2", "i3"],
              "key": "i2",
              "key_length": "8",
              "used_key_parts": ["c0"],
              "ref": ["mariadb_prune0_cost_misrank.t3.c0"],
              "loops": 10000000,
              "r_loops": 10000000,
              "rows": 4,
              "r_rows": 0,
              "cost": 14134.60246,
              "r_table_time_ms": 6597.597704,
              "r_other_time_ms": 301.1377703,
              "r_engine_stats": {
                "pages_accessed": 20000000
              },
              "filtered": 100,
              "r_total_filtered": 100,
              "r_filtered": 100,
              "using_index": true,
              "distinct": true
            }
          }
        ]
      }
    }
  }
} |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+-------------------------------------------------+
| probe                                           |
+-------------------------------------------------+
| C/forced bad-shape JOIN_ORDER(t3,t2,t1) ANALYZE |
+-------------------------------------------------+
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ANALYZE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| {
  "query_optimization": {
    "r_total_time_ms": 0.108401723
  },
  "query_block": {
    "select_id": 1,
    "cost": 18780.77009,
    "r_loops": 1,
    "r_total_time_ms": 10959.13629,
    "filesort": {
      "sort_key": "t3.c2 desc",
      "r_loops": 1,
      "r_total_time_ms": 0.005676124,
      "r_limit": 8,
      "r_used_priority_queue": true,
      "r_output_rows": 0,
      "r_sort_mode": "sort_key,rowid",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "t3",
              "access_type": "ALL",
              "possible_keys": ["i6", "i7"],
              "loops": 1,
              "r_loops": 1,
              "rows": 5000,
              "r_rows": 5000,
              "cost": 0.8403864,
              "r_table_time_ms": 1.338804305,
              "r_other_time_ms": 0.372769881,
              "r_engine_stats": {
                "pages_accessed": 18
              },
              "filtered": 100,
              "r_total_filtered": 100,
              "r_filtered": 100
            }
          },
          {
            "block-nl-join": {
              "table": {
                "table_name": "t2",
                "access_type": "ALL",
                "possible_keys": ["i4"],
                "loops": 5000,
                "r_loops": 1,
                "rows": 10000,
                "r_rows": 10000,
                "cost": 4645.327246,
                "r_table_time_ms": 4.799915295,
                "r_other_time_ms": 0.399549237,
                "r_engine_stats": {
                  "pages_accessed": 52
                },
                "filtered": 20,
                "r_total_filtered": 100,
                "r_filtered": 100
              },
              "buffer_type": "flat",
              "buffer_size": "92KiB",
              "join_type": "BNL",
              "attached_condition": "t2.c0 = t3.c0",
              "r_loops": 5000,
              "r_filtered": 20,
              "r_unpack_time_ms": 1953.602525,
              "r_other_time_ms": 2367.668235,
              "r_effective_rows": 10000
            }
          },
          {
            "table": {
              "table_name": "t1",
              "access_type": "ref",
              "possible_keys": ["i2", "i3"],
              "key": "i2",
              "key_length": "8",
              "used_key_parts": ["c0"],
              "ref": ["mariadb_prune0_cost_misrank.t3.c0"],
              "loops": 10000000,
              "r_loops": 10000000,
              "rows": 4,
              "r_rows": 0,
              "cost": 14134.60246,
              "r_table_time_ms": 6350.578018,
              "r_other_time_ms": 280.3562034,
              "r_engine_stats": {
                "pages_accessed": 20000000
              },
              "filtered": 100,
              "r_total_filtered": 100,
              "r_filtered": 100,
              "using_index": true,
              "distinct": true
            }
          }
        ]
      }
    }
  }
} |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+----------------------------------------------------+
| probe                                              |
+----------------------------------------------------+
| D/forced early-reject JOIN_ORDER(t2,t1,t3) EXPLAIN |
+----------------------------------------------------+
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| EXPLAIN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| {
  "query_block": {
    "select_id": 1,
    "cost": 58600.96749,
    "filesort": {
      "sort_key": "t3.c2 desc",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "t2",
              "access_type": "ALL",
              "possible_keys": ["i4"],
              "loops": 1,
              "rows": 10000,
              "cost": 1.7229156,
              "filtered": 100
            }
          },
          {
            "table": {
              "table_name": "t1",
              "access_type": "ref",
              "possible_keys": ["i2", "i3"],
              "key": "i2",
              "key_length": "8",
              "used_key_parts": ["c0"],
              "ref": ["mariadb_prune0_cost_misrank.t2.c0"],
              "loops": 10000,
              "rows": 4,
              "cost": 14.1370576,
              "filtered": 100,
              "using_index": true
            }
          },
          {
            "block-nl-join": {
              "table": {
                "table_name": "t3",
                "access_type": "ALL",
                "possible_keys": ["i6", "i7"],
                "loops": 40000,
                "rows": 5000,
                "cost": 30753.80323,
                "filtered": 20
              },
              "buffer_type": "flat",
              "buffer_size": "256KiB",
              "join_type": "BNL",
              "attached_condition": "t3.c0 = t2.c0"
            }
          }
        ]
      }
    }
  }
} |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+----------------------------------------------------+
| probe                                              |
+----------------------------------------------------+
| E/forced early-reject JOIN_ORDER(t2,t1,t3) ANALYZE |
+----------------------------------------------------+
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ANALYZE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| {
  "query_optimization": {
    "r_total_time_ms": 0.079513231
  },
  "query_block": {
    "select_id": 1,
    "cost": 58600.96749,
    "r_loops": 1,
    "r_total_time_ms": 10.45576429,
    "filesort": {
      "sort_key": "t3.c2 desc",
      "r_loops": 1,
      "r_total_time_ms": 0.004126927,
      "r_limit": 8,
      "r_used_priority_queue": true,
      "r_output_rows": 0,
      "r_sort_mode": "sort_key,rowid",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "t2",
              "access_type": "ALL",
              "possible_keys": ["i4"],
              "loops": 1,
              "r_loops": 1,
              "rows": 10000,
              "r_rows": 10000,
              "cost": 1.7229156,
              "r_table_time_ms": 3.131242703,
              "r_other_time_ms": 0.70971277,
              "r_engine_stats": {
                "pages_accessed": 52
              },
              "filtered": 100,
              "r_total_filtered": 100,
              "r_filtered": 100
            }
          },
          {
            "table": {
              "table_name": "t1",
              "access_type": "ref",
              "possible_keys": ["i2", "i3"],
              "key": "i2",
              "key_length": "8",
              "used_key_parts": ["c0"],
              "ref": ["mariadb_prune0_cost_misrank.t2.c0"],
              "loops": 10000,
              "r_loops": 10000,
              "rows": 4,
              "r_rows": 0,
              "cost": 14.1370576,
              "r_table_time_ms": 6.344548965,
              "r_other_time_ms": 0.254972501,
              "r_engine_stats": {
                "pages_accessed": 20000
              },
              "filtered": 100,
              "r_total_filtered": 100,
              "r_filtered": 100,
              "using_index": true
            }
          },
          {
            "block-nl-join": {
              "table": {
                "table_name": "t3",
                "access_type": "ALL",
                "possible_keys": ["i6", "i7"],
                "loops": 40000,
                "r_loops": 0,
                "rows": 5000,
                "r_rows": null,
                "cost": 30753.80323,
                "r_engine_stats": {},
                "filtered": 20,
                "r_total_filtered": null,
                "r_filtered": null
              },
              "buffer_type": "flat",
              "buffer_size": "256KiB",
              "join_type": "BNL",
              "attached_condition": "t3.c0 = t2.c0",
              "r_loops": 0,
              "r_filtered": null,
              "r_unpack_time_ms": 0,
              "r_other_time_ms": 0,
              "r_effective_rows": null
            }
          }
        ]
      }
    }
  }
} |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+----------------------------------------------------+
| probe                                              |
+----------------------------------------------------+
| F/forced early-reject JOIN_ORDER(t3,t1,t2) EXPLAIN |
+----------------------------------------------------+
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| EXPLAIN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| {
  "query_block": {
    "select_id": 1,
    "cost": 30758.89383,
    "filesort": {
      "sort_key": "t3.c2 desc",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "t3",
              "access_type": "ALL",
              "possible_keys": ["i6", "i7"],
              "loops": 1,
              "rows": 5000,
              "cost": 0.8403864,
              "filtered": 100
            }
          },
          {
            "table": {
              "table_name": "t1",
              "access_type": "ref",
              "possible_keys": ["i2", "i3"],
              "key": "i2",
              "key_length": "8",
              "used_key_parts": ["c0"],
              "ref": ["mariadb_prune0_cost_misrank.t3.c0"],
              "loops": 5000,
              "rows": 4,
              "cost": 7.0697576,
              "filtered": 100,
              "using_index": true
            }
          },
          {
            "block-nl-join": {
              "table": {
                "table_name": "t2",
                "access_type": "ALL",
                "possible_keys": ["i4"],
                "loops": 20000,
                "rows": 10000,
                "cost": 30750.98369,
                "filtered": 20
              },
              "buffer_type": "flat",
              "buffer_size": "256KiB",
              "join_type": "BNL",
              "attached_condition": "t2.c0 = t3.c0"
            }
          }
        ]
      }
    }
  }
} |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+----------------------------------------------------+
| probe                                              |
+----------------------------------------------------+
| G/forced early-reject JOIN_ORDER(t3,t1,t2) ANALYZE |
+----------------------------------------------------+
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ANALYZE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| {
  "query_optimization": {
    "r_total_time_ms": 0.080787482
  },
  "query_block": {
    "select_id": 1,
    "cost": 30758.89383,
    "r_loops": 1,
    "r_total_time_ms": 5.25837327,
    "filesort": {
      "sort_key": "t3.c2 desc",
      "r_loops": 1,
      "r_total_time_ms": 0.004101351,
      "r_limit": 8,
      "r_used_priority_queue": true,
      "r_output_rows": 0,
      "r_sort_mode": "sort_key,rowid",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "t3",
              "access_type": "ALL",
              "possible_keys": ["i6", "i7"],
              "loops": 1,
              "r_loops": 1,
              "rows": 5000,
              "r_rows": 5000,
              "cost": 0.8403864,
              "r_table_time_ms": 1.437561003,
              "r_other_time_ms": 0.381868669,
              "r_engine_stats": {
                "pages_accessed": 18
              },
              "filtered": 100,
              "r_total_filtered": 100,
              "r_filtered": 100
            }
          },
          {
            "table": {
              "table_name": "t1",
              "access_type": "ref",
              "possible_keys": ["i2", "i3"],
              "key": "i2",
              "key_length": "8",
              "used_key_parts": ["c0"],
              "ref": ["mariadb_prune0_cost_misrank.t3.c0"],
              "loops": 5000,
              "r_loops": 5000,
              "rows": 4,
              "r_rows": 0,
              "cost": 7.0697576,
              "r_table_time_ms": 3.292746418,
              "r_other_time_ms": 0.132445323,
              "r_engine_stats": {
                "pages_accessed": 10000
              },
              "filtered": 100,
              "r_total_filtered": 100,
              "r_filtered": 100,
              "using_index": true
            }
          },
          {
            "block-nl-join": {
              "table": {
                "table_name": "t2",
                "access_type": "ALL",
                "possible_keys": ["i4"],
                "loops": 20000,
                "r_loops": 0,
                "rows": 10000,
                "r_rows": null,
                "cost": 30750.98369,
                "r_engine_stats": {},
                "filtered": 20,
                "r_total_filtered": null,
                "r_filtered": null
              },
              "buffer_type": "flat",
              "buffer_size": "256KiB",
              "join_type": "BNL",
              "attached_condition": "t2.c0 = t3.c0",
              "r_loops": 0,
              "r_filtered": null,
              "r_unpack_time_ms": 0,
              "r_other_time_ms": 0,
              "r_effective_rows": null
            }
          }
        ]
      }
    }
  }
} |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+----------------------------------------------------------------------------------+
| section                                                                          |
+----------------------------------------------------------------------------------+
| === Control: pruning levels 1 and 2 usually avoid the bad full-search choice === |
+----------------------------------------------------------------------------------+
+---------------------------------------------+
| probe                                       |
+---------------------------------------------+
| H/base ANALYZE with optimizer_prune_level=1 |
+---------------------------------------------+
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ANALYZE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| {
  "query_optimization": {
    "r_total_time_ms": 0.078200616
  },
  "query_block": {
    "select_id": 1,
    "cost": 30758.89383,
    "r_loops": 1,
    "r_total_time_ms": 5.035742982,
    "filesort": {
      "sort_key": "t3.c2 desc",
      "r_loops": 1,
      "r_total_time_ms": 0.003595305,
      "r_limit": 8,
      "r_used_priority_queue": true,
      "r_output_rows": 0,
      "r_sort_mode": "sort_key,rowid",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "t3",
              "access_type": "ALL",
              "possible_keys": ["i6", "i7"],
              "loops": 1,
              "r_loops": 1,
              "rows": 5000,
              "r_rows": 5000,
              "cost": 0.8403864,
              "r_table_time_ms": 1.389951533,
              "r_other_time_ms": 0.355978091,
              "r_engine_stats": {
                "pages_accessed": 18
              },
              "filtered": 100,
              "r_total_filtered": 100,
              "r_filtered": 100
            }
          },
          {
            "table": {
              "table_name": "t1",
              "access_type": "ref",
              "possible_keys": ["i2", "i3"],
              "key": "i2",
              "key_length": "8",
              "used_key_parts": ["c0"],
              "ref": ["mariadb_prune0_cost_misrank.t3.c0"],
              "loops": 5000,
              "r_loops": 5000,
              "rows": 4,
              "r_rows": 0,
              "cost": 7.0697576,
              "r_table_time_ms": 3.152666553,
              "r_other_time_ms": 0.125634705,
              "r_engine_stats": {
                "pages_accessed": 10000
              },
              "filtered": 100,
              "r_total_filtered": 100,
              "r_filtered": 100,
              "using_index": true
            }
          },
          {
            "block-nl-join": {
              "table": {
                "table_name": "t2",
                "access_type": "ALL",
                "possible_keys": ["i4"],
                "loops": 20000,
                "r_loops": 0,
                "rows": 10000,
                "r_rows": null,
                "cost": 30750.98369,
                "r_engine_stats": {},
                "filtered": 20,
                "r_total_filtered": null,
                "r_filtered": null
              },
              "buffer_type": "flat",
              "buffer_size": "256KiB",
              "join_type": "BNL",
              "attached_condition": "t2.c0 = t3.c0",
              "r_loops": 0,
              "r_filtered": null,
              "r_unpack_time_ms": 0,
              "r_other_time_ms": 0,
              "r_effective_rows": null
            }
          }
        ]
      }
    }
  }
} |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+---------------------------------------------+
| probe                                       |
+---------------------------------------------+
| I/base ANALYZE with optimizer_prune_level=2 |
+---------------------------------------------+
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ANALYZE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| {
  "query_optimization": {
    "r_total_time_ms": 0.066457416
  },
  "query_block": {
    "select_id": 1,
    "cost": 30758.89383,
    "r_loops": 1,
    "r_total_time_ms": 5.025158939,
    "filesort": {
      "sort_key": "t3.c2 desc",
      "r_loops": 1,
      "r_total_time_ms": 0.002489127,
      "r_limit": 8,
      "r_used_priority_queue": true,
      "r_output_rows": 0,
      "r_sort_mode": "sort_key,rowid",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "t3",
              "access_type": "ALL",
              "possible_keys": ["i6", "i7"],
              "loops": 1,
              "r_loops": 1,
              "rows": 5000,
              "r_rows": 5000,
              "cost": 0.8403864,
              "r_table_time_ms": 1.382711598,
              "r_other_time_ms": 0.352899794,
              "r_engine_stats": {
                "pages_accessed": 18
              },
              "filtered": 100,
              "r_total_filtered": 100,
              "r_filtered": 100
            }
          },
          {
            "table": {
              "table_name": "t1",
              "access_type": "ref",
              "possible_keys": ["i2", "i3"],
              "key": "i2",
              "key_length": "8",
              "used_key_parts": ["c0"],
              "ref": ["mariadb_prune0_cost_misrank.t3.c0"],
              "loops": 5000,
              "r_loops": 5000,
              "rows": 4,
              "r_rows": 0,
              "cost": 7.0697576,
              "r_table_time_ms": 3.154593001,
              "r_other_time_ms": 0.125944362,
              "r_engine_stats": {
                "pages_accessed": 10000
              },
              "filtered": 100,
              "r_total_filtered": 100,
              "r_filtered": 100,
              "using_index": true
            }
          },
          {
            "block-nl-join": {
              "table": {
                "table_name": "t2",
                "access_type": "ALL",
                "possible_keys": ["i4"],
                "loops": 20000,
                "r_loops": 0,
                "rows": 10000,
                "r_rows": null,
                "cost": 30750.98369,
                "r_engine_stats": {},
                "filtered": 20,
                "r_total_filtered": null,
                "r_filtered": null
              },
              "buffer_type": "flat",
              "buffer_size": "256KiB",
              "join_type": "BNL",
              "attached_condition": "t2.c0 = t3.c0",
              "r_loops": 0,
              "r_filtered": null,
              "r_unpack_time_ms": 0,
              "r_other_time_ms": 0,
              "r_effective_rows": null
            }
          }
        ]
      }
    }
  }
} |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+-----------------------------------------------+
| section                                       |
+-----------------------------------------------+
| === Optimizer trace for prune=0 base plan === |
+-----------------------------------------------+
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| EXPLAIN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| {
  "query_block": {
    "select_id": 1,
    "cost": 18780.77009,
    "filesort": {
      "sort_key": "t3.c2 desc",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "t3",
              "access_type": "ALL",
              "possible_keys": ["i6", "i7"],
              "loops": 1,
              "rows": 5000,
              "cost": 0.8403864,
              "filtered": 100
            }
          },
          {
            "block-nl-join": {
              "table": {
                "table_name": "t2",
                "access_type": "ALL",
                "possible_keys": ["i4"],
                "loops": 5000,
                "rows": 10000,
                "cost": 4645.327246,
                "filtered": 20
              },
              "buffer_type": "flat",
              "buffer_size": "92KiB",
              "join_type": "BNL",
              "attached_condition": "t2.c0 = t3.c0"
            }
          },
          {
            "table": {
              "table_name": "t1",
              "access_type": "ref",
              "possible_keys": ["i2", "i3"],
              "key": "i2",
              "key_length": "8",
              "used_key_parts": ["c0"],
              "ref": ["mariadb_prune0_cost_misrank.t3.c0"],
              "loops": 10000000,
              "rows": 4,
              "cost": 14134.60246,
              "filtered": 100,
              "using_index": true,
              "distinct": true
            }
          }
        ]
      }
    }
  }
} |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| TRACE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| {
  "steps": [
    {
      "join_preparation": {
        "select_id": 1,
        "steps": [
          {
            "expanded_query": "select distinct t2.c4 AS ref0,t3.c2 AS c2,t2.c5 AS c5 from ((t2 join t1 on(t2.c0 = t1.c0)) join t3 on(t1.c0 = t3.c0)) order by t3.c2 desc limit 8"
          }
        ]
      }
    },
    {
      "join_optimization": {
        "select_id": 1,
        "steps": [
          {
            "condition_processing": {
              "condition": "WHERE",
              "original_condition": "t1.c0 = t3.c0 and t2.c0 = t1.c0",
              "steps": [
                {
                  "transformation": "equality_propagation",
                  "resulting_condition": "multiple equal(t1.c0, t3.c0, t2.c0)"
                },
                {
                  "transformation": "constant_propagation",
                  "resulting_condition": "multiple equal(t1.c0, t3.c0, t2.c0)"
                },
                {
                  "transformation": "trivial_condition_removal",
                  "resulting_condition": "multiple equal(t1.c0, t3.c0, t2.c0)"
                }
              ]
            }
          },
          {
            "ref_optimizer_key_uses": [
              {
                "table": "t2",
                "index": "i4",
                "field": "c0",
                "equals": "t3.c0",
                "null_rejecting": false
              },
              {
                "table": "t2",
                "index": "i4",
                "field": "c0",
                "equals": "t1.c0",
                "null_rejecting": false
              },
              {
                "table": "t1",
                "index": "i2",
                "field": "c0",
                "equals": "t3.c0",
                "null_rejecting": false
              },
              {
                "table": "t1",
                "index": "i2",
                "field": "c0",
                "equals": "t2.c0",
                "null_rejecting": false
              },
              {
                "table": "t1",
                "index": "i3",
                "field": "c0",
                "equals": "t2.c0",
                "null_rejecting": false
              },
              {
                "table": "t1",
                "index": "i3",
                "field": "c0",
                "equals": "t3.c0",
                "null_rejecting": false
              },
              {
                "table": "t3",
                "index": "i6",
                "field": "c0",
                "equals": "t1.c0",
                "null_rejecting": false
              },
              {
                "table": "t3",
                "index": "i6",
                "field": "c0",
                "equals": "t2.c0",
                "null_rejecting": false
              },
              {
                "table": "t3",
                "index": "i7",
                "field": "c0",
                "equals": "t2.c0",
                "null_rejecting": false
              },
              {
                "table": "t3",
                "index": "i7",
                "field": "c0",
                "equals": "t1.c0",
                "null_rejecting": false
              }
            ]
          },
          {
            "rows_estimation": [
              {
                "table": "t2",
                "table_scan": {
                  "rows": 10000,
                  "read_cost": 1.4029156,
                  "read_and_compare_cost": 1.7229156
                }
              },
              {
                "table": "t1",
                "table_scan": {
                  "rows": 2000,
                  "read_cost": 0.23772552,
                  "read_and_compare_cost": 0.30172552
                }
              },
              {
                "table": "t3",
                "table_scan": {
                  "rows": 5000,
                  "read_cost": 0.6803864,
                  "read_and_compare_cost": 0.8403864
                }
              }
            ]
          },
          {
            "table_dependencies": [
              {
                "table": "t2",
                "row_may_be_null": false,
                "map_bit": 0,
                "depends_on_map_bits": []
              },
              {
                "table": "t1",
                "row_may_be_null": false,
                "map_bit": 1,
                "depends_on_map_bits": []
              },
              {
                "table": "t3",
                "row_may_be_null": false,
                "map_bit": 2,
                "depends_on_map_bits": []
              }
            ]
          },
          {
            "considered_execution_plans": [
              {
                "plan_prefix": "",
                "get_costs_for_tables": [
                  {
                    "best_access_path": {
                      "table": "t1",
                      "plan_details": {
                        "record_count": 1
                      },
                      "considered_access_paths": [
                        {
                          "access_type": "scan",
                          "rows": 2000,
                          "rows_after_filter": 2000,
                          "rows_out": 2000,
                          "cost": 0.30172552,
                          "index_only": true,
                          "chosen": true
                        }
                      ],
                      "chosen_access_method": {
                        "type": "scan",
                        "rows_read": 2000,
                        "rows_out": 2000,
                        "cost": 0.30172552,
                        "uses_join_buffering": false
                      }
                    }
                  },
                  {
                    "best_access_path": {
                      "table": "t3",
                      "plan_details": {
                        "record_count": 1
                      },
                      "considered_access_paths": [
                        {
                          "access_type": "scan",
                          "rows": 5000,
                          "rows_after_filter": 5000,
                          "rows_out": 5000,
                          "cost": 0.8403864,
                          "index_only": false,
                          "chosen": true
                        }
                      ],
                      "chosen_access_method": {
                        "type": "scan",
                        "rows_read": 5000,
                        "rows_out": 5000,
                        "cost": 0.8403864,
                        "uses_join_buffering": false
                      }
                    }
                  },
                  {
                    "best_access_path": {
                      "table": "t2",
                      "plan_details": {
                        "record_count": 1
                      },
                      "considered_access_paths": [
                        {
                          "access_type": "scan",
                          "rows": 10000,
                          "rows_after_filter": 10000,
                          "rows_out": 10000,
                          "cost": 1.7229156,
                          "index_only": false,
                          "chosen": true
                        }
                      ],
                      "chosen_access_method": {
                        "type": "scan",
                        "rows_read": 10000,
                        "rows_out": 10000,
                        "cost": 1.7229156,
                        "uses_join_buffering": false
                      }
                    }
                  }
                ]
              },
              {
                "plan_prefix": "",
                "table": "t1",
                "rows_for_plan": 2000,
                "cost_for_plan": 0.30172552,
                "rest_of_plan": [
                  {
                    "plan_prefix": "t1",
                    "get_costs_for_tables": [
                      {
                        "best_access_path": {
                          "table": "t3",
                          "plan_details": {
                            "record_count": 2000
                          },
                          "considered_access_paths": [
                            {
                              "access_type": "ref",
                              "index": "i6",
                              "used_range_estimates": false,
                              "reason": "not available",
                              "rows": 1000,
                              "cost": 1988.624301,
                              "chosen": true
                            },
                            {
                              "access_type": "ref",
                              "index": "i7",
                              "rows": 1000,
                              "cost": 1988.627578,
                              "chosen": false,
                              "cause": "cost"
                            },
                            {
                              "access_type": "scan_with_join_cache",
                              "rows": 5000,
                              "rows_after_filter": 5000,
                              "rows_out": 1000,
                              "cost": 929.6221184,
                              "cost_without_join_buffer": 1651.296346,
                              "index_only": false,
                              "chosen": true
                            }
                          ],
                          "chosen_access_method": {
                            "type": "scan",
                            "rows_read": 5000,
                            "rows_out": 1000,
                            "cost": 929.6221184,
                            "uses_join_buffering": true
                          }
                        }
                      },
                      {
                        "best_access_path": {
                          "table": "t2",
                          "plan_details": {
                            "record_count": 2000
                          },
                          "considered_access_paths": [
                            {
                              "access_type": "ref",
                              "index": "i4",
                              "used_range_estimates": false,
                              "reason": "not available",
                              "rows": 2000,
                              "cost": 3975.645133,
                              "chosen": true
                            },
                            {
                              "access_type": "scan_with_join_cache",
                              "rows": 10000,
                              "rows_after_filter": 10000,
                              "rows_out": 2000,
                              "cost": 1859.164648,
                              "cost_without_join_buffer": 3286.985862,
                              "index_only": false,
                              "chosen": true
                            }
                          ],
                          "chosen_access_method": {
                            "type": "scan",
                            "rows_read": 10000,
                            "rows_out": 2000,
                            "cost": 1859.164648,
                            "uses_join_buffering": true
                          }
                        }
                      }
                    ]
                  },
                  {
                    "plan_prefix": "t1",
                    "table": "t3",
                    "rows_for_plan": 2000000,
                    "cost_for_plan": 929.9238439,
                    "pushdown_cond_selectivity": 0.2,
                    "filtered": 20,
                    "rows_out": 1000,
                    "rest_of_plan": [
                      {
                        "plan_prefix": "t1,t3",
                        "get_costs_for_tables": [
                          {
                            "best_access_path": {
                              "table": "t2",
                              "plan_details": {
                                "record_count": 2000000
                              },
                              "considered_access_paths": [
                                {
                                  "access_type": "ref",
                                  "index": "i4",
                                  "used_range_estimates": false,
                                  "reason": "not available",
                                  "rows": 2000,
                                  "cost": 3975555.929,
                                  "chosen": true
                                },
                                {
                                  "access_type": "scan_with_join_cache",
                                  "rows": 10000,
                                  "rows_after_filter": 10000,
                                  "rows_out": 2000,
                                  "cost": 3075075.711,
                                  "cost_without_join_buffer": 3286906.479,
                                  "index_only": false,
                                  "chosen": true
                                }
                              ],
                              "chosen_access_method": {
                                "type": "scan",
                                "rows_read": 10000,
                                "rows_out": 2000,
                                "cost": 3075075.711,
                                "uses_join_buffering": true
                              }
                            }
                          }
                        ]
                      },
                      {
                        "plan_prefix": "t1,t3",
                        "table": "t2",
                        "rows_for_plan": 4000000000,
                        "cost_for_plan": 3076005.635,
                        "pushdown_cond_selectivity": 0.2,
                        "filtered": 20,
                        "rows_out": 2000,
                        "cost_for_sorting": 2855006.322
                      }
                    ]
                  },
                  {
                    "plan_prefix": "t1",
                    "table": "t2",
                    "rows_for_plan": 4000000,
                    "cost_for_plan": 1859.466373,
                    "pushdown_cond_selectivity": 0.2,
                    "filtered": 20,
                    "rows_out": 2000,
                    "rest_of_plan": [
                      {
                        "plan_prefix": "t1,t2",
                        "get_costs_for_tables": [
                          {
                            "best_access_path": {
                              "table": "t3",
                              "plan_details": {
                                "record_count": 4000000
                              },
                              "considered_access_paths": [
                                {
                                  "access_type": "ref",
                                  "index": "i6",
                                  "used_range_estimates": false,
                                  "reason": "not available",
                                  "rows": 1000,
                                  "cost": 3977209.3,
                                  "chosen": true
                                },
                                {
                                  "access_type": "ref",
                                  "index": "i7",
                                  "rows": 1000,
                                  "cost": 3977209.303,
                                  "chosen": false,
                                  "cause": "cost"
                                },
                                {
                                  "access_type": "scan_with_join_cache",
                                  "rows": 5000,
                                  "rows_after_filter": 5000,
                                  "rows_out": 1000,
                                  "cost": 3075299.602,
                                  "cost_without_join_buffer": 3302563.215,
                                  "index_only": false,
                                  "chosen": true
                                }
                              ],
                              "chosen_access_method": {
                                "type": "scan",
                                "rows_read": 5000,
                                "rows_out": 1000,
                                "cost": 3075299.602,
                                "uses_join_buffering": true
                              }
                            }
                          }
                        ]
                      },
                      {
                        "plan_prefix": "t1,t2",
                        "table": "t3",
                        "rows_for_plan": 4000000000,
                        "cost_for_plan": 3077159.068,
                        "pushdown_cond_selectivity": 0.2,
                        "filtered": 20,
                        "rows_out": 1000,
                        "cost_for_sorting": 2855006.322
                      }
                    ]
                  }
                ]
              },
              {
                "plan_prefix": "",
                "table": "t3",
                "rows_for_plan": 5000,
                "cost_for_plan": 0.8403864,
                "rest_of_plan": [
                  {
                    "plan_prefix": "t3",
                    "get_costs_for_tables": [
                      {
                        "best_access_path": {
                          "table": "t1",
                          "plan_details": {
                            "record_count": 5000
                          },
                          "considered_access_paths": [
                            {
                              "access_type": "ref",
                              "index": "i2",
                              "used_range_estimates": false,
                              "reason": "not available",
                              "rows": 4,
                              "cost": 7.0697576,
                              "chosen": true
                            },
                            {
                              "access_type": "ref",
                              "index": "i3",
                              "rows": 4,
                              "cost": 7.0705768,
                              "chosen": false,
                              "cause": "cost"
                            },
                            {
                              "type": "scan",
                              "chosen": false,
                              "cause": "cost"
                            }
                          ],
                          "chosen_access_method": {
                            "type": "ref",
                            "index": "i2",
                            "rows_read": 4,
                            "rows_out": 4,
                            "cost": 7.0697576,
                            "uses_join_buffering": false
                          }
                        }
                      },
                      {
                        "best_access_path": {
                          "table": "t2",
                          "plan_details": {
                            "record_count": 5000
                          },
                          "considered_access_paths": [
                            {
                              "access_type": "ref",
                              "index": "i4",
                              "used_range_estimates": false,
                              "reason": "not available",
                              "rows": 2000,
                              "cost": 9938.978893,
                              "chosen": true
                            },
                            {
                              "access_type": "scan_with_join_cache",
                              "rows": 10000,
                              "rows_after_filter": 10000,
                              "rows_out": 2000,
                              "cost": 4645.327246,
                              "cost_without_join_buffer": 8217.345462,
                              "index_only": false,
                              "chosen": true
                            }
                          ],
                          "chosen_access_method": {
                            "type": "scan",
                            "rows_read": 10000,
                            "rows_out": 2000,
                            "cost": 4645.327246,
                            "uses_join_buffering": true
                          }
                        }
                      }
                    ]
                  },
                  {
                    "plan_prefix": "t3",
                    "table": "t1",
                    "rows_for_plan": 20000,
                    "cost_for_plan": 7.910144,
                    "rest_of_plan": [
                      {
                        "plan_prefix": "t3,t1",
                        "get_costs_for_tables": [
                          {
                            "best_access_path": {
                              "table": "t2",
                              "plan_details": {
                                "record_count": 20000
                              },
                              "considered_access_paths": [
                                {
                                  "access_type": "ref",
                                  "index": "i4",
                                  "used_range_estimates": false,
                                  "reason": "not available",
                                  "rows": 2000,
                                  "cost": 39755.64769,
                                  "chosen": true
                                },
                                {
                                  "access_type": "scan_with_join_cache",
                                  "rows": 10000,
                                  "rows_after_filter": 10000,
                                  "rows_out": 2000,
                                  "cost": 30750.98369,
                                  "cost_without_join_buffer": 32869.14346,
                                  "index_only": false,
                                  "chosen": true
                                }
                              ],
                              "chosen_access_method": {
                                "type": "scan",
                                "rows_read": 10000,
                                "rows_out": 2000,
                                "cost": 30750.98369,
                                "uses_join_buffering": true
                              }
                            }
                          }
                        ]
                      },
                      {
                        "plan_prefix": "t3,t1",
                        "table": "t2",
                        "rows_for_plan": 40000000,
                        "cost_for_plan": 30758.89383,
                        "pushdown_cond_selectivity": 0.2,
                        "filtered": 20,
                        "rows_out": 2000
                      }
                    ]
                  },
                  {
                    "plan_prefix": "t3",
                    "table": "t2",
                    "rows_for_plan": 10000000,
                    "cost_for_plan": 4646.167632,
                    "pushdown_cond_selectivity": 0.2,
                    "filtered": 20,
                    "rows_out": 2000,
                    "rest_of_plan": [
                      {
                        "plan_prefix": "t3,t2",
                        "get_costs_for_tables": [
                          {
                            "best_access_path": {
                              "table": "t1",
                              "plan_details": {
                                "record_count": 10000000
                              },
                              "considered_access_paths": [
                                {
                                  "access_type": "ref",
                                  "index": "i2",
                                  "used_range_estimates": false,
                                  "reason": "not available",
                                  "rows": 4,
                                  "cost": 14134.60246,
                                  "chosen": true
                                },
                                {
                                  "access_type": "ref",
                                  "index": "i3",
                                  "rows": 4,
                                  "cost": 14134.60328,
                                  "chosen": false,
                                  "cause": "cost"
                                },
                                {
                                  "type": "scan",
                                  "chosen": false,
                                  "cause": "cost"
                                }
                              ],
                              "chosen_access_method": {
                                "type": "ref",
                                "index": "i2",
                                "rows_read": 4,
                                "rows_out": 4,
                                "cost": 14134.60246,
                                "uses_join_buffering": false
                              }
                            }
                          }
                        ]
                      },
                      {
                        "plan_prefix": "t3,t2",
                        "table": "t1",
                        "rows_for_plan": 40000000,
                        "cost_for_plan": 18780.77009
                      }
                    ]
                  }
                ]
              },
              {
                "plan_prefix": "",
                "table": "t2",
                "rows_for_plan": 10000,
                "cost_for_plan": 1.7229156,
                "rest_of_plan": [
                  {
                    "plan_prefix": "t2",
                    "get_costs_for_tables": [
                      {
                        "best_access_path": {
                          "table": "t3",
                          "plan_details": {
                            "record_count": 10000
                          },
                          "considered_access_paths": [
                            {
                              "access_type": "ref",
                              "index": "i6",
                              "used_range_estimates": false,
                              "reason": "not available",
                              "rows": 1000,
                              "cost": 9943.042861,
                              "chosen": true
                            },
                            {
                              "access_type": "ref",
                              "index": "i7",
                              "rows": 1000,
                              "cost": 9943.046138,
                              "chosen": false,
                              "cause": "cost"
                            },
                            {
                              "access_type": "scan_with_join_cache",
                              "rows": 5000,
                              "rows_after_filter": 5000,
                              "rows_out": 1000,
                              "cost": 4644.749046,
                              "cost_without_join_buffer": 8256.422746,
                              "index_only": false,
                              "chosen": true
                            }
                          ],
                          "chosen_access_method": {
                            "type": "scan",
                            "rows_read": 5000,
                            "rows_out": 1000,
                            "cost": 4644.749046,
                            "uses_join_buffering": true
                          }
                        }
                      },
                      {
                        "best_access_path": {
                          "table": "t1",
                          "plan_details": {
                            "record_count": 10000
                          },
                          "considered_access_paths": [
                            {
                              "access_type": "ref",
                              "index": "i2",
                              "used_range_estimates": false,
                              "reason": "not available",
                              "rows": 4,
                              "cost": 14.1370576,
                              "chosen": true
                            },
                            {
                              "access_type": "ref",
                              "index": "i3",
                              "rows": 4,
                              "cost": 14.1378768,
                              "chosen": false,
                              "cause": "cost"
                            },
                            {
                              "type": "scan",
                              "chosen": false,
                              "cause": "cost"
                            }
                          ],
                          "chosen_access_method": {
                            "type": "ref",
                            "index": "i2",
                            "rows_read": 4,
                            "rows_out": 4,
                            "cost": 14.1370576,
                            "uses_join_buffering": false
                          }
                        }
                      }
                    ]
                  },
                  {
                    "plan_prefix": "t2",
                    "table": "t1",
                    "rows_for_plan": 40000,
                    "cost_for_plan": 15.8599732,
                    "rest_of_plan": [
                      {
                        "plan_prefix": "t2,t1",
                        "get_costs_for_tables": [
                          {
                            "best_access_path": {
                              "table": "t3",
                              "plan_details": {
                                "record_count": 40000
                              },
                              "considered_access_paths": [
                                {
                                  "access_type": "ref",
                                  "index": "i6",
                                  "used_range_estimates": false,
                                  "reason": "not available",
                                  "rows": 1000,
                                  "cost": 39772.11246,
                                  "chosen": true
                                },
                                {
                                  "access_type": "ref",
                                  "index": "i7",
                                  "rows": 1000,
                                  "cost": 39772.11574,
                                  "chosen": false,
                                  "cause": "cost"
                                },
                                {
                                  "access_type": "scan_with_join_cache",
                                  "rows": 5000,
                                  "rows_after_filter": 5000,
                                  "rows_out": 1000,
                                  "cost": 30753.80323,
                                  "cost_without_join_buffer": 33025.64675,
                                  "index_only": false,
                                  "chosen": true
                                }
                              ],
                              "chosen_access_method": {
                                "type": "scan",
                                "rows_read": 5000,
                                "rows_out": 1000,
                                "cost": 30753.80323,
                                "uses_join_buffering": true
                              }
                            }
                          }
                        ]
                      },
                      {
                        "plan_prefix": "t2,t1",
                        "table": "t3",
                        "rows_for_plan": 40000000,
                        "cost_for_plan": 30769.6632,
                        "pruned_by_cost": true,
                        "current_cost": 30769.6632,
                        "best_cost": 18780.77009
                      }
                    ]
                  },
                  {
                    "plan_prefix": "t2",
                    "table": "t3",
                    "rows_for_plan": 10000000,
                    "cost_for_plan": 4646.471962,
                    "pushdown_cond_selectivity": 0.2,
                    "filtered": 20,
                    "rows_out": 1000,
                    "rest_of_plan": [
                      {
                        "plan_prefix": "t2,t3",
                        "get_costs_for_tables": [
                          {
                            "best_access_path": {
                              "table": "t1",
                              "plan_details": {
                                "record_count": 10000000
                              },
                              "considered_access_paths": [
                                {
                                  "access_type": "ref",
                                  "index": "i2",
                                  "used_range_estimates": false,
                                  "reason": "not available",
                                  "rows": 4,
                                  "cost": 14134.60246,
                                  "chosen": true
                                },
                                {
                                  "access_type": "ref",
                                  "index": "i3",
                                  "rows": 4,
                                  "cost": 14134.60328,
                                  "chosen": false,
                                  "cause": "cost"
                                },
                                {
                                  "type": "scan",
                                  "chosen": false,
                                  "cause": "cost"
                                }
                              ],
                              "chosen_access_method": {
                                "type": "ref",
                                "index": "i2",
                                "rows_read": 4,
                                "rows_out": 4,
                                "cost": 14134.60246,
                                "uses_join_buffering": false
                              }
                            }
                          }
                        ]
                      },
                      {
                        "plan_prefix": "t2,t3",
                        "table": "t1",
                        "rows_for_plan": 40000000,
                        "cost_for_plan": 18781.07442,
                        "pruned_by_cost": true,
                        "current_cost": 18781.07442,
                        "best_cost": 18780.77009
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "best_join_order": ["t3", "t2", "t1"],
            "rows": 40000000,
            "cost": 18780.77009
          },
          {
            "substitute_best_equal": {
              "condition": "WHERE",
              "resulting_condition": "t2.c0 = t3.c0 and t1.c0 = t3.c0"
            }
          },
          {
            "attaching_conditions_to_tables": {
              "attached_conditions_computation": [
                {
                  "table": "t2",
                  "range_analysis": {
                    "table_scan": {
                      "rows": 10000,
                      "cost": 1.7229156
                    },
                    "potential_range_indexes": [
                      {
                        "index": "i4",
                        "usable": true,
                        "key_parts": ["c0"]
                      },
                      {
                        "index": "i5",
                        "usable": false,
                        "cause": "not applicable"
                      }
                    ],
                    "setup_range_conditions": [],
                    "analyzing_range_alternatives": {
                      "range_scan_alternatives": [
                        {
                          "index": "i4"
                        }
                      ],
                      "analyzing_roworder_intersect": {
                        "cause": "too few roworder scans"
                      }
                    },
                    "group_index_range": {
                      "chosen": false,
                      "cause": "not single_table"
                    }
                  }
                }
              ],
              "attached_conditions_summary": [
                {
                  "table": "t3",
                  "attached_condition": null
                },
                {
                  "table": "t2",
                  "attached_condition": "t2.c0 = t3.c0"
                },
                {
                  "table": "t1",
                  "attached_condition": null
                }
              ]
            }
          },
          {
            "make_join_readinfo": []
          }
        ]
      }
    }
  ]
} |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+----------------------------------------+
| section                                |
+----------------------------------------+
| === What to look for in the output === |
+----------------------------------------+
+---------------------------------------------------------------------------------------------------------------------------------------------+
| expected_bad_plan                                                                                                                           |
+---------------------------------------------------------------------------------------------------------------------------------------------+
| In the prune=0 base ANALYZE, check nested_loop order t3 -> t2 -> t1, t1.r_loops around 10,000,000, t1.r_rows = 0, and high r_total_time_ms. |
+---------------------------------------------------------------------------------------------------------------------------------------------+
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| expected_fast_plan                                                                                                                                                        |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| In JOIN_ORDER(t2,t1,t3) or JOIN_ORDER(t3,t1,t2), check that t1 is probed early, the third table has r_loops = 0, and runtime is much lower despite higher estimated cost. |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| expected_trace                                                                                                                                                     |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| In optimizer trace, compare cost_for_plan for t3,t2,t1 against the early-reject alternatives; the chosen best_join_order should explain the cost-model misranking. |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+--------------+
| section      |
+--------------+
| === Done === |
+--------------+
