Skip to content
  • Oystein Grovlen's avatar
    4bf48e8b
    WL#8737 IO aware defaults for optimizer cost constants · 4bf48e8b
    Oystein Grovlen authored
    Update default values for optimizer cost constants. New values are:
    
      row_evaluate_cost             0.1
      key_compare_cost              0.05
      memory_temptable_create_cost  1.0
      memory_temptable_row_cost     0.1
      disk_temptable_create_cost    20.0
      disk_temptable_row_cost       0.5
      memory_block_read_cost        0.25
      io_block_read_cost            1.0
    
    Changes to source files:
    
    sql/opt_costconstants.cc
      Changed default values for cost constants.
    sql/sql_select.h
      Change type of JOIN_TAB::read_time from ha_rows to double since cost may now
      be lower than 1.
    sql/sql_optimizer.cc
    sql/sql_select.cc
      Removed casts when assigning to/from JOIN_TAB::read_time
    unittest/gunit/opt_costconstants-t.cc
      Updated unit tests to use new values for cost constants
    
    Changes in tests:
    
    mysql-test/include/join_cache.inc
      Added more data in one table to preserve original query plan.
    mysql-test/include/mix1.inc
      Added more data in in two tables to preserve original query plan.
    mysql-test/r/count_distinct.result
      User variable changed because plans go from BNL to ref access
    mysql-test/t/dd_is_compatibility.test
    mysql-test/r/dd_is_compatibility.result
    mysql-test/r/dd_is_compatibility_ci.result
      Lowered setting of max_join_size to make sure test still get ER_TOO_BIG_SELECT
    mysql-test/r/delete.result
      Changed join order gives more warnings
    mysql-test/r/endspace.result
      Query returned result in different order, re-recorded.
    mysql-test/r/explain.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/r/explain_for_connection_rqg_json.result
      Change in two query plans, updated cost numbers in EXPLAIN JSON.
    mysql-test/r/explain_for_connection_rqg_trad.result
      Change in one query plan, updated cost numbers in EXPLAIN JSON.
    mysql-test/r/explain_for_connection_small_json.result
    mysql-test/r/explain_for_connection_small_trad.result
      One query changes from table scan to ref access, due to magic constants
      added when calculating cost for tables scan. Two queries changes from
      index scan to ref access due to lower cost of doing ref access. Updated cost
      numbers in EXPLAIN JSON.
    mysql-test/r/explain_json_all.result
      Re-recorded new query plan for one query since it no longer tested
      what the original test was for. Updated cost numbers in EXPLAIN JSON.
    mysql-test/r/explain_json_none.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/t/explain_other.test
    mysql-test/r/explain_other.result
      Added more data to one table in order to preserver original query plan.
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/r/func_concat.result
      Changed from table scan with BNL to eq_ref access.
      The new plan is identical to the plan when the test case was added.
    mysql-test/r/greedy_optimizer.result
      Several queries got new query plan. All new query plans resulted in a
      lower number of Handler_reads. Updated Last_query_cost numbers.
    mysql-test/r/greedy_search.result
      No changes in query plans but the number of partial plans evaluated
      was changed for several queries.
    mysql-test/r/group_by.result
      Changed from table scan with BNL to ref access
    mysql-test/r/group_min_max.result
      Four queries changes from doing index scan to use range scan due to
      range scan becoming cheaper with all data in memory buffer.
    mysql-test/r/heap_hash.result
      One query changes from using join buffer to use ref access for join.
      This is what the original test used, accepted new plan.
    mysql-test/r/index_merge_innodb.result
      One query changes from ref to range. This is caused by using DS-MRR for the
      range scan. Updated cost numbers in EXPLAIN JSON.
    mysql-test/include/index_merge_intersect_dml.inc
    mysql-test/r/index_merge_intersect_dml.result
      One query changed from doing range scan on primary key to range scan on
      secondary key. Changed query to switch back to use primary key.
    mysql-test/r/index_merge_myisam.result
    mysql-test/r/innodb_explain_json_non_select_all.result
    mysql-test/r/innodb_explain_json_non_select_none.result
    mysql-test/r/internal_tmp_disk_storage_engine.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/t/join.test
    mysql-test/r/join.result
      Query plan changes for two queries. First fixed by increasing the range
      interval in the query. The second query changes from table scan to
      eq_ref for one table, re-recorded new query plan. Updated Last_query_cost
      numbers.
    mysql-test/r/join_cache_bka.result
      Four queries changes from using BNL to use BKA/ref access.
    mysql-test/r/join_cache_bka_nixbnl.result
      One query changes from table scan to BKA/ref access.
      One query changes join order
    mysql-test/r/join_cache_bkaunique.result
      Four queries changes from using BNL to use BKA-unique/ref access.
    mysql-test/r/join_cache_bnl.result
      Four queries changes from using BNL to use ref access due to ref access
      becoming cheaper with all data in a memory buffer.
    mysql-test/r/join_cache_nojb.result
      Changed join order for one query due to ref access becomming relatively
      less costly compared to table scan when all data is in a memory buffer.
    mysql-test/r/join_outer.result
      Changes in order of results from a few queries, re-recorded. Updated cost
      numbers in EXPLAIN JSON.
    mysql-test/r/join_outer_bka.result
    mysql-test/r/join_outer_bka_nixbnl.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/r/key.result
      Updated Last_query_cost numbers.
    mysql-test/r/key_diff.result
      One query changes from using join buffering to ref access. The new plan
      has also been accepted as plan for this query before, so just use it.
    mysql-test/r/myisam.result
      One query changes from table scan to range scan, likely due to use of
      magic constants when calculating cost of table scan.
    mysql-test/r/myisam_explain_json_non_select_all.result
    mysql-test/r/myisam_explain_json_non_select_none.result
      Updated cost numbers in EXPLAIN JSON plus two rows estimates in explain.
    mysql-test/r/myisam_icp.result
    mysql-test/r/myisam_icp_all.result
    mysql-test/r/myisam_icp_none.result
      Changes to query plans for two bugs that was reported for InnoDB.
      Accepted changes since the plan is still the same when run with
      InnoDB.
    mysql-test/t/opt_costmodel.test
    mysql-test/r/opt_costmodel.result
    mysql-test/t/opt_costmodel_flush.test
    mysql-test/r/opt_costmodel_flush.result
      Updated to use new cost numbers, updated result files.
    mysql-test/r/opt_costmodel_restart.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/r/opt_hints.result
      Changes from ref access to range access. Does not affect purpose of test
    mysql-test/t/opt_hints_subquery.test
    mysql-test/r/opt_hints_subquery.result
      A lot of changes to explain output:
      -Most of the changes are from using join buffer to ref access (ok)
      -Some changes are in join order (ok)
      -Some changes are in semijoin strategy; adjusted test cases so hints
       are used according to original purpose of tests.
    mysql-test/r/order_by_all.result
    mysql-test/r/order_by_icp_mrr.result
    mysql-test/r/order_by_none.result
      Two queries joining three tables changes join order. The new query plans are
      equal to earlier query plans, so no attempt on reproducing current query
      plans.
    mysql-test/r/partition.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/t/partition_locking.test
    mysql-test/r/partition_locking.result
      Many queries changed from doing index scan to range scan. Adjusted
      the queries to use index scan. For the last query, the plan change
      is accepted since it is the same as the initial query plan.
    mysql-test/t/partition_pruning.test
    mysql-test/r/partition_pruning.result
      Two queries changed from table scan to range scan. Adjusted queries
      to produce same plan.
    mysql-test/r/range_all.result
    mysql-test/r/range_icp.result
    mysql-test/r/range_icp_mrr.result
    mysql-test/r/range_mrr.result
    mysql-test/r/range_mrr_cost.result
    mysql-test/r/range_none.result
    mysql-test/r/range_with_memory_limit.result
      Change in three query plans. The first is due to range scan becoming cheaper
      than table scan, and join buffering is no longer considered. The two last is
      Change in join order due to differences in cost estimate for ref access
      versus join buffering. The new plan is more similar to initial plan for
      these two queries.
    mysql-test/include/select.inc
    mysql-test/r/select_all.result
    mysql-test/r/select_all_bka.result
    mysql-test/r/select_icp_mrr.result
    mysql-test/r/select_icp_mrr_bka.result
      Two identical queries switches from using join buffering to use ref access.
      Change accepted since ref access was the original join method for these
      queries.
    mysql-test/r/select_none.result
    mysql-test/r/select_none_bka.result
    mysql-test/r/select_none_bka_nixbnl.result
      In addition to the two queries above, a third query changes from table
      scan to range scan due to range access is cheaper with all data in memory.
      Accepted new plan since range scan was the origianal plan when the bug
      was first fixed.
    mysql-test/r/select_all_bka_nixbnl.result
    mysql-test/r/select_icp_mrr_nixbnl.result
      Updated result file after adding sorted_result for two queries in select.inc
    mysql-test/t/select_safe.test
    mysql-test/r/select_safe.result
      Adjusted value for max_join_size to make query fail.
    mysql-test/t/single_delete_update.test
    mysql-test/r/single_delete_update.result
      Two limit queries changed from doing file sort to using index. The
      test assumed that is should use filesort, so increased the limit to
      produce original query plan. Needed to adjust some other parts of
      the test due to this.
    mysql-test/r/status.result
      Updated Last_query_cost numbers.
    mysql-test/r/subquery_all.result
    mysql-test/r/subquery_all_bka.result
      Five queries have changes in query plans:
      -Change from using join buffer to ref access due to ref access is less costly
       with all data in memory buffer.
      -Join order changes due to minor changes in cost estimates, the new
       plan is identical to a former plan for this query.
      -Last three queries change from using join buffering to use ref access
       due to ref access is less costly with data in memory. The query plan for
       these queries has changed several times so no effort on reproducing
       original plan.
    mysql-test/r/subquery_all_bka_nixbnl.result
      Join order changes for one query due to minor changes in cost estimates,
      the new plan is identical to a former plan for this query.
    mysql-test/r/subquery_mat_all.result
      Several queries changes from using DuplicateWeedout to FirstMatch due
      to the cost of FirstMatch reading data is now lower compared to using
      the temporary table. The query plan for these queries have changed
      several times so no attempt on reproducing original query plan.
    mysql-test/r/subquery_nomat_nosj.result
    mysql-test/r/subquery_nomat_nosj_bka.result
    mysql-test/r/subquery_none.result
    mysql-test/r/subquery_none_bka.result
      Join order changes for two queries due to minor changes in cost estimates.
    mysql-test/r/subquery_nomat_nosj_bka_nixbnl.result
    mysql-test/r/subquery_none_bka_nixbnl.result
      Join order change for one query due to minor changes in cost estimates.
    mysql-test/r/subquery_sj_all.result
    mysql-test/r/subquery_sj_all_bka.result
    mysql-test/r/subquery_sj_all_bka_nixbnl.result
    mysql-test/r/subquery_sj_all_bkaunique.result
      About 25 queries has changes in query plans:
      -Materialization to FirstMatch: FirstMatch becomes cheaper due to the
       cost of reading the data when it is in memory is now lower
      -Materialization to DupsWeedOut: Some of the changes are due to
       materialization and dupsweedout having the exact same cost and the change
       is caused by rounding errors. In a few cases, the cost of DupsWeedOut
       is now lower than Materialization.
      -DupsWeedout to FirstMatch: FirstMatch benefits more from having all
       data in a memory buffer
      -Join method: Changing from using join buffer to use eq_ref or ref:
       eq_ref and ref get a lower cost when all data is in a memory buffer
    mysql-test/r/subquery_sj_dupsweed.result
    mysql-test/r/subquery_sj_dupsweed_bka.result
    mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result
    mysql-test/r/subquery_sj_dupsweed_bkaunique.result
      A few queries have changes in query plan, no changes in semi-join strategy:
      -Join method: Changing from using join buffer to use eq_ref or ref:
       eq_ref and ref get a lower cost when all data is in a memory buffer.
       This causes changes to join order.
    mysql-test/r/subquery_sj_firstmatch.result
    mysql-test/r/subquery_sj_firstmatch_bka.result
    mysql-test/r/subquery_sj_firstmatch_bkaunique.result
      A few queries have changes in query plan, no change in semi-join strategy:
      -Join method: Changing from using join buffer to use eq_ref or ref:
       eq_ref and ref get a lower cost when all data is in a memory buffer.
       This causes changes to join order.
    mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/r/subquery_sj_loosescan.result
    mysql-test/r/subquery_sj_loosescan_bka.result
    mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result
    mysql-test/r/subquery_sj_loosescan_bkaunique.result
      A few queries have changes in query plan, no change in semi-join strategy:
      -Join order: due to changes in cost estimates, verified that current
       plan is not the same as origianal plan, so just re-recorded.
      -Join method: Changing from using join buffer to use eq_ref or ref:
       eq_ref and ref get a lower cost when all data is in a memory buffer.
       This causes changes to join order.
    mysql-test/r/subquery_sj_mat.result
    mysql-test/r/subquery_sj_mat_bka.result
    mysql-test/r/subquery_sj_mat_bka_nixbnl.result
    mysql-test/r/subquery_sj_mat_bkaunique.result
      A few queries have changes in query plan:
      -Join order: due to changes in cost estimates, verified that current
       plan is not the same as origianal plan, so just re-recorded.
      -Join method: Changing from using join buffer to use eq_ref or ref:
       eq_ref and ref get a lower cost when all data is in a memory buffer.
       This causes changes to join order.
      -One query changes from MaterializeLookup to MaterializeScan.
    mysql-test/r/subquery_sj_mat_nosj.result
      A few queries change from using join buffer to use eq_ref or ref:
      eq_ref and ref get a lower cost when all data is in a memory buffer. This
      causes changes to join order.
    mysql-test/r/subquery_sj_none.result
    mysql-test/r/subquery_sj_none_bka.result
    mysql-test/r/subquery_sj_none_bkaunique.result
      One query changes from using join buffer to use eq_ref or ref:
      eq_ref and ref get a lower cost when all data is in a memory buffer. This
      causes changes to join order.
    mysql-test/r/subquery_sj_none_bka_nixbnl.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/r/type_blob.result
      Change from ALL to ref_or_null.  Back to plan before switch to InnoDB
    mysql-test/r/type_ranges.result
      Order of warnings changed for an INSERT INTO SELECT statement likely due
      to plan change. Re-recorded result file.
    mysql-test/r/user_var.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/suite/engines/iuds/r/insert_calendar.result
    mysql-test/suite/engines/iuds/t/insert_calendar.test
      Different plans for MyISAM and InnoDB caused different number of warnings.
      Changed start date for range for query to avoid warnings for zero date.
    mysql-test/suite/gcol/inc/gcol_ins_upd.inc
    mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result
    mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result
      Added sorted_result to some queries to handle that the order of the
      result changes. This happened for the MyISAM test, the InnoDB test
      had the same order.
    mysql-test/suite/gcol/r/gcol_keys_innodb.result
    mysql-test/suite/gcol/r/gcol_keys_myisam.result
      Changed plans from table scan to index usage
    mysql-test/suite/gcol/r/gcol_select_myisam.result
      One query changes join order and switches from join buffering to ref
      access.
    mysql-test/suite/gcol/r/gcol_select_innodb.result
      One query changes from using join buffering to do ref access. This is
      caused by table scan becoming relatively more costly compared to ref
      access.
    mysql-test/suite/innodb/t/innodb_mysql.test
    mysql-test/suite/innodb/r/innodb_mysql.result
      Added extra rows to a few tables to preserve original query plan.
    mysql-test/suite/innodb/include/query_workload_itt.inc
    mysql-test/suite/innodb/r/optimizer_temporary_table.result
      Cost estimates of EXPLAIN JSON was unstable since one table was not used
      for a while and sometimes its pages was flushed from buffer pool.
      Added a query that does a table scan to ensure that pages are in buffer pool.
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/suite/innodb_gis/r/create_spatial_index.result
    mysql-test/suite/innodb_gis/r/rtree.result
    mysql-test/suite/innodb_gis/r/rtree_multi_pk.result
      Changes in query plans from full table/index scan to range scan
      Queries will now actually use a spatial index
    mysql-test/suite/innodb/r/temporary_table.result
    mysql-test/suite/innodb/r/temporary_table_optimization.result
    mysql-test/suite/innodb_zip/r/wl6469.result
    mysql-test/suite/innodb_zip/r/wl6560.result
      A few queries changes from table scan to range scan due to use of magic
      constants in the cost model for table scan.
    mysql-test/suite/innodb_fts/r/opt.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/suite/json/r/json_agg.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/suite/opt_trace/r/bugs_no_prot_all.result
    mysql-test/suite/opt_trace/r/bugs_ps_prot_all.result
      Updated cost estimate numbers in optimizer trace output.
      There are a few minor changes in the optimizer trace output
      and a few plan changes.
    mysql-test/suite/opt_trace/r/bugs_no_prot_none.result
    mysql-test/suite/opt_trace/r/bugs_ps_prot_none.result
    mysql-test/suite/opt_trace/r/fulltext.result
    mysql-test/suite/opt_trace/r/general2_no_prot.result
    mysql-test/suite/opt_trace/r/general2_ps_prot.result
    mysql-test/suite/opt_trace/r/general_no_prot_none.result
    mysql-test/suite/opt_trace/r/general_ps_prot_none.result
    mysql-test/suite/opt_trace/r/range_no_prot.result
    mysql-test/suite/opt_trace/r/range_ps_prot.result
      Updated cost estimate numbers in optimizer trace output.
      There are a few tiny minor change in the optimizer trace output.
    mysql-test/suite/opt_trace/r/charset.result
    mysql-test/suite/opt_trace/r/eq_range_statistics.result
    mysql-test/suite/opt_trace/r/filesort_pack.result
    mysql-test/suite/opt_trace/r/filesort_pq.result
    mysql-test/suite/opt_trace/r/general_no_prot_all.result
    mysql-test/suite/opt_trace/r/general_ps_prot_all.result
    mysql-test/suite/opt_trace/r/subquery_no_prot.result
    mysql-test/suite/opt_trace/r/subquery_ps_prot.result
    mysql-test/suite/opt_trace/r/temp_table.result
      Updated cost estimate numbers in optimizer trace output.
    mysql-test/suite/opt_trace/r/security_no_prot.result
    mysql-test/suite/opt_trace/r/security_ps_prot.result
      Updated length numbers for optimizer trace output.
    mysql-test/suite/parts/r/partition_icp.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/suite/sysschema/r/pr_statement_performance_analyzer.result
      Changed query plans give different number for rows_examined
    mysql-test/suite/sys_vars/r/max_join_size_func.result
    mysql-test/suite/sys_vars/r/sql_big_selects_func.result
    mysql-test/suite/sys_vars/t/max_join_size_func.test
    mysql-test/suite/sys_vars/t/sql_big_selects_func.test
      Reduced value for max_join_size to make queries fail with new cost constants.
    mysql-test/suite/test_service_sql_api/r/test_sql_stmt.result
      Changed result order due to different access method
    mysql-test/suite/i_main/r/bug18932813.result
    mysql-test/suite/i_main/r/derived.result
    mysql-test/suite/i_main/r/explain_json.result
    mysql-test/suite/i_main/r/group_by.result
    mysql-test/suite/i_main/r/partition_icp.result
    mysql-test/suite/i_main/r/subquery_mat_cost_based.result
    mysql-test/suite/i_main/r/view.result
      Updated cost numbers in EXPLAIN JSON.
    .../mysql-test/suite/i_main/r/bug22671573.result
      Plan changed from table scan to range scan.
      Verified that test case still reproduce the original bug.
    .../mysql-test/suite/i_main/r/costmodel_planchange.result
      Adjust queries to still identify plan changes
    .../mysql-test/suite/i_main/t/insert.test
    .../mysql-test/suite/i_main/r/insert.result
      Added data to keep same query plan
    .../mysql-test/suite/i_main/t/subquery-bug22262843.test
    .../mysql-test/suite/i_main/r/subquery-bug22262843.result
      Added a row so that subquery materialization is still used.
    .../mysql-test/suite/i_main/t/subquery.test
    .../mysql-test/suite/i_main/r/subquery.result
      Added data to keep on query plan
      Some changes from table scan (with BNL) to ref access
      Some semijoin strategy changes that seems reasonable
    .../mysql-test/suite/i_opt_trace/include/bugs.inc
      Added analyze table to make test stable
    .../mysql-test/suite/i_opt_trace/r/bugs_no_prot.result
    .../mysql-test/suite/i_opt_trace/r/bugs_ps_prot.result
    .../mysql-test/suite/i_opt_trace/r/query_cache_trace.result
      Updated cost numbers in EXPLAIN JSON.
    .../mysql-test/suite/i_opt_trace/r/refaccess_trace.result
      One query plan goes from table scan to eq_ref
      Updated cost numbers in EXPLAIN JSON.
    
    Implemented by Olav Sandstå
    4bf48e8b
    WL#8737 IO aware defaults for optimizer cost constants
    Oystein Grovlen authored
    Update default values for optimizer cost constants. New values are:
    
      row_evaluate_cost             0.1
      key_compare_cost              0.05
      memory_temptable_create_cost  1.0
      memory_temptable_row_cost     0.1
      disk_temptable_create_cost    20.0
      disk_temptable_row_cost       0.5
      memory_block_read_cost        0.25
      io_block_read_cost            1.0
    
    Changes to source files:
    
    sql/opt_costconstants.cc
      Changed default values for cost constants.
    sql/sql_select.h
      Change type of JOIN_TAB::read_time from ha_rows to double since cost may now
      be lower than 1.
    sql/sql_optimizer.cc
    sql/sql_select.cc
      Removed casts when assigning to/from JOIN_TAB::read_time
    unittest/gunit/opt_costconstants-t.cc
      Updated unit tests to use new values for cost constants
    
    Changes in tests:
    
    mysql-test/include/join_cache.inc
      Added more data in one table to preserve original query plan.
    mysql-test/include/mix1.inc
      Added more data in in two tables to preserve original query plan.
    mysql-test/r/count_distinct.result
      User variable changed because plans go from BNL to ref access
    mysql-test/t/dd_is_compatibility.test
    mysql-test/r/dd_is_compatibility.result
    mysql-test/r/dd_is_compatibility_ci.result
      Lowered setting of max_join_size to make sure test still get ER_TOO_BIG_SELECT
    mysql-test/r/delete.result
      Changed join order gives more warnings
    mysql-test/r/endspace.result
      Query returned result in different order, re-recorded.
    mysql-test/r/explain.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/r/explain_for_connection_rqg_json.result
      Change in two query plans, updated cost numbers in EXPLAIN JSON.
    mysql-test/r/explain_for_connection_rqg_trad.result
      Change in one query plan, updated cost numbers in EXPLAIN JSON.
    mysql-test/r/explain_for_connection_small_json.result
    mysql-test/r/explain_for_connection_small_trad.result
      One query changes from table scan to ref access, due to magic constants
      added when calculating cost for tables scan. Two queries changes from
      index scan to ref access due to lower cost of doing ref access. Updated cost
      numbers in EXPLAIN JSON.
    mysql-test/r/explain_json_all.result
      Re-recorded new query plan for one query since it no longer tested
      what the original test was for. Updated cost numbers in EXPLAIN JSON.
    mysql-test/r/explain_json_none.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/t/explain_other.test
    mysql-test/r/explain_other.result
      Added more data to one table in order to preserver original query plan.
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/r/func_concat.result
      Changed from table scan with BNL to eq_ref access.
      The new plan is identical to the plan when the test case was added.
    mysql-test/r/greedy_optimizer.result
      Several queries got new query plan. All new query plans resulted in a
      lower number of Handler_reads. Updated Last_query_cost numbers.
    mysql-test/r/greedy_search.result
      No changes in query plans but the number of partial plans evaluated
      was changed for several queries.
    mysql-test/r/group_by.result
      Changed from table scan with BNL to ref access
    mysql-test/r/group_min_max.result
      Four queries changes from doing index scan to use range scan due to
      range scan becoming cheaper with all data in memory buffer.
    mysql-test/r/heap_hash.result
      One query changes from using join buffer to use ref access for join.
      This is what the original test used, accepted new plan.
    mysql-test/r/index_merge_innodb.result
      One query changes from ref to range. This is caused by using DS-MRR for the
      range scan. Updated cost numbers in EXPLAIN JSON.
    mysql-test/include/index_merge_intersect_dml.inc
    mysql-test/r/index_merge_intersect_dml.result
      One query changed from doing range scan on primary key to range scan on
      secondary key. Changed query to switch back to use primary key.
    mysql-test/r/index_merge_myisam.result
    mysql-test/r/innodb_explain_json_non_select_all.result
    mysql-test/r/innodb_explain_json_non_select_none.result
    mysql-test/r/internal_tmp_disk_storage_engine.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/t/join.test
    mysql-test/r/join.result
      Query plan changes for two queries. First fixed by increasing the range
      interval in the query. The second query changes from table scan to
      eq_ref for one table, re-recorded new query plan. Updated Last_query_cost
      numbers.
    mysql-test/r/join_cache_bka.result
      Four queries changes from using BNL to use BKA/ref access.
    mysql-test/r/join_cache_bka_nixbnl.result
      One query changes from table scan to BKA/ref access.
      One query changes join order
    mysql-test/r/join_cache_bkaunique.result
      Four queries changes from using BNL to use BKA-unique/ref access.
    mysql-test/r/join_cache_bnl.result
      Four queries changes from using BNL to use ref access due to ref access
      becoming cheaper with all data in a memory buffer.
    mysql-test/r/join_cache_nojb.result
      Changed join order for one query due to ref access becomming relatively
      less costly compared to table scan when all data is in a memory buffer.
    mysql-test/r/join_outer.result
      Changes in order of results from a few queries, re-recorded. Updated cost
      numbers in EXPLAIN JSON.
    mysql-test/r/join_outer_bka.result
    mysql-test/r/join_outer_bka_nixbnl.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/r/key.result
      Updated Last_query_cost numbers.
    mysql-test/r/key_diff.result
      One query changes from using join buffering to ref access. The new plan
      has also been accepted as plan for this query before, so just use it.
    mysql-test/r/myisam.result
      One query changes from table scan to range scan, likely due to use of
      magic constants when calculating cost of table scan.
    mysql-test/r/myisam_explain_json_non_select_all.result
    mysql-test/r/myisam_explain_json_non_select_none.result
      Updated cost numbers in EXPLAIN JSON plus two rows estimates in explain.
    mysql-test/r/myisam_icp.result
    mysql-test/r/myisam_icp_all.result
    mysql-test/r/myisam_icp_none.result
      Changes to query plans for two bugs that was reported for InnoDB.
      Accepted changes since the plan is still the same when run with
      InnoDB.
    mysql-test/t/opt_costmodel.test
    mysql-test/r/opt_costmodel.result
    mysql-test/t/opt_costmodel_flush.test
    mysql-test/r/opt_costmodel_flush.result
      Updated to use new cost numbers, updated result files.
    mysql-test/r/opt_costmodel_restart.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/r/opt_hints.result
      Changes from ref access to range access. Does not affect purpose of test
    mysql-test/t/opt_hints_subquery.test
    mysql-test/r/opt_hints_subquery.result
      A lot of changes to explain output:
      -Most of the changes are from using join buffer to ref access (ok)
      -Some changes are in join order (ok)
      -Some changes are in semijoin strategy; adjusted test cases so hints
       are used according to original purpose of tests.
    mysql-test/r/order_by_all.result
    mysql-test/r/order_by_icp_mrr.result
    mysql-test/r/order_by_none.result
      Two queries joining three tables changes join order. The new query plans are
      equal to earlier query plans, so no attempt on reproducing current query
      plans.
    mysql-test/r/partition.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/t/partition_locking.test
    mysql-test/r/partition_locking.result
      Many queries changed from doing index scan to range scan. Adjusted
      the queries to use index scan. For the last query, the plan change
      is accepted since it is the same as the initial query plan.
    mysql-test/t/partition_pruning.test
    mysql-test/r/partition_pruning.result
      Two queries changed from table scan to range scan. Adjusted queries
      to produce same plan.
    mysql-test/r/range_all.result
    mysql-test/r/range_icp.result
    mysql-test/r/range_icp_mrr.result
    mysql-test/r/range_mrr.result
    mysql-test/r/range_mrr_cost.result
    mysql-test/r/range_none.result
    mysql-test/r/range_with_memory_limit.result
      Change in three query plans. The first is due to range scan becoming cheaper
      than table scan, and join buffering is no longer considered. The two last is
      Change in join order due to differences in cost estimate for ref access
      versus join buffering. The new plan is more similar to initial plan for
      these two queries.
    mysql-test/include/select.inc
    mysql-test/r/select_all.result
    mysql-test/r/select_all_bka.result
    mysql-test/r/select_icp_mrr.result
    mysql-test/r/select_icp_mrr_bka.result
      Two identical queries switches from using join buffering to use ref access.
      Change accepted since ref access was the original join method for these
      queries.
    mysql-test/r/select_none.result
    mysql-test/r/select_none_bka.result
    mysql-test/r/select_none_bka_nixbnl.result
      In addition to the two queries above, a third query changes from table
      scan to range scan due to range access is cheaper with all data in memory.
      Accepted new plan since range scan was the origianal plan when the bug
      was first fixed.
    mysql-test/r/select_all_bka_nixbnl.result
    mysql-test/r/select_icp_mrr_nixbnl.result
      Updated result file after adding sorted_result for two queries in select.inc
    mysql-test/t/select_safe.test
    mysql-test/r/select_safe.result
      Adjusted value for max_join_size to make query fail.
    mysql-test/t/single_delete_update.test
    mysql-test/r/single_delete_update.result
      Two limit queries changed from doing file sort to using index. The
      test assumed that is should use filesort, so increased the limit to
      produce original query plan. Needed to adjust some other parts of
      the test due to this.
    mysql-test/r/status.result
      Updated Last_query_cost numbers.
    mysql-test/r/subquery_all.result
    mysql-test/r/subquery_all_bka.result
      Five queries have changes in query plans:
      -Change from using join buffer to ref access due to ref access is less costly
       with all data in memory buffer.
      -Join order changes due to minor changes in cost estimates, the new
       plan is identical to a former plan for this query.
      -Last three queries change from using join buffering to use ref access
       due to ref access is less costly with data in memory. The query plan for
       these queries has changed several times so no effort on reproducing
       original plan.
    mysql-test/r/subquery_all_bka_nixbnl.result
      Join order changes for one query due to minor changes in cost estimates,
      the new plan is identical to a former plan for this query.
    mysql-test/r/subquery_mat_all.result
      Several queries changes from using DuplicateWeedout to FirstMatch due
      to the cost of FirstMatch reading data is now lower compared to using
      the temporary table. The query plan for these queries have changed
      several times so no attempt on reproducing original query plan.
    mysql-test/r/subquery_nomat_nosj.result
    mysql-test/r/subquery_nomat_nosj_bka.result
    mysql-test/r/subquery_none.result
    mysql-test/r/subquery_none_bka.result
      Join order changes for two queries due to minor changes in cost estimates.
    mysql-test/r/subquery_nomat_nosj_bka_nixbnl.result
    mysql-test/r/subquery_none_bka_nixbnl.result
      Join order change for one query due to minor changes in cost estimates.
    mysql-test/r/subquery_sj_all.result
    mysql-test/r/subquery_sj_all_bka.result
    mysql-test/r/subquery_sj_all_bka_nixbnl.result
    mysql-test/r/subquery_sj_all_bkaunique.result
      About 25 queries has changes in query plans:
      -Materialization to FirstMatch: FirstMatch becomes cheaper due to the
       cost of reading the data when it is in memory is now lower
      -Materialization to DupsWeedOut: Some of the changes are due to
       materialization and dupsweedout having the exact same cost and the change
       is caused by rounding errors. In a few cases, the cost of DupsWeedOut
       is now lower than Materialization.
      -DupsWeedout to FirstMatch: FirstMatch benefits more from having all
       data in a memory buffer
      -Join method: Changing from using join buffer to use eq_ref or ref:
       eq_ref and ref get a lower cost when all data is in a memory buffer
    mysql-test/r/subquery_sj_dupsweed.result
    mysql-test/r/subquery_sj_dupsweed_bka.result
    mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result
    mysql-test/r/subquery_sj_dupsweed_bkaunique.result
      A few queries have changes in query plan, no changes in semi-join strategy:
      -Join method: Changing from using join buffer to use eq_ref or ref:
       eq_ref and ref get a lower cost when all data is in a memory buffer.
       This causes changes to join order.
    mysql-test/r/subquery_sj_firstmatch.result
    mysql-test/r/subquery_sj_firstmatch_bka.result
    mysql-test/r/subquery_sj_firstmatch_bkaunique.result
      A few queries have changes in query plan, no change in semi-join strategy:
      -Join method: Changing from using join buffer to use eq_ref or ref:
       eq_ref and ref get a lower cost when all data is in a memory buffer.
       This causes changes to join order.
    mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/r/subquery_sj_loosescan.result
    mysql-test/r/subquery_sj_loosescan_bka.result
    mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result
    mysql-test/r/subquery_sj_loosescan_bkaunique.result
      A few queries have changes in query plan, no change in semi-join strategy:
      -Join order: due to changes in cost estimates, verified that current
       plan is not the same as origianal plan, so just re-recorded.
      -Join method: Changing from using join buffer to use eq_ref or ref:
       eq_ref and ref get a lower cost when all data is in a memory buffer.
       This causes changes to join order.
    mysql-test/r/subquery_sj_mat.result
    mysql-test/r/subquery_sj_mat_bka.result
    mysql-test/r/subquery_sj_mat_bka_nixbnl.result
    mysql-test/r/subquery_sj_mat_bkaunique.result
      A few queries have changes in query plan:
      -Join order: due to changes in cost estimates, verified that current
       plan is not the same as origianal plan, so just re-recorded.
      -Join method: Changing from using join buffer to use eq_ref or ref:
       eq_ref and ref get a lower cost when all data is in a memory buffer.
       This causes changes to join order.
      -One query changes from MaterializeLookup to MaterializeScan.
    mysql-test/r/subquery_sj_mat_nosj.result
      A few queries change from using join buffer to use eq_ref or ref:
      eq_ref and ref get a lower cost when all data is in a memory buffer. This
      causes changes to join order.
    mysql-test/r/subquery_sj_none.result
    mysql-test/r/subquery_sj_none_bka.result
    mysql-test/r/subquery_sj_none_bkaunique.result
      One query changes from using join buffer to use eq_ref or ref:
      eq_ref and ref get a lower cost when all data is in a memory buffer. This
      causes changes to join order.
    mysql-test/r/subquery_sj_none_bka_nixbnl.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/r/type_blob.result
      Change from ALL to ref_or_null.  Back to plan before switch to InnoDB
    mysql-test/r/type_ranges.result
      Order of warnings changed for an INSERT INTO SELECT statement likely due
      to plan change. Re-recorded result file.
    mysql-test/r/user_var.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/suite/engines/iuds/r/insert_calendar.result
    mysql-test/suite/engines/iuds/t/insert_calendar.test
      Different plans for MyISAM and InnoDB caused different number of warnings.
      Changed start date for range for query to avoid warnings for zero date.
    mysql-test/suite/gcol/inc/gcol_ins_upd.inc
    mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result
    mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result
      Added sorted_result to some queries to handle that the order of the
      result changes. This happened for the MyISAM test, the InnoDB test
      had the same order.
    mysql-test/suite/gcol/r/gcol_keys_innodb.result
    mysql-test/suite/gcol/r/gcol_keys_myisam.result
      Changed plans from table scan to index usage
    mysql-test/suite/gcol/r/gcol_select_myisam.result
      One query changes join order and switches from join buffering to ref
      access.
    mysql-test/suite/gcol/r/gcol_select_innodb.result
      One query changes from using join buffering to do ref access. This is
      caused by table scan becoming relatively more costly compared to ref
      access.
    mysql-test/suite/innodb/t/innodb_mysql.test
    mysql-test/suite/innodb/r/innodb_mysql.result
      Added extra rows to a few tables to preserve original query plan.
    mysql-test/suite/innodb/include/query_workload_itt.inc
    mysql-test/suite/innodb/r/optimizer_temporary_table.result
      Cost estimates of EXPLAIN JSON was unstable since one table was not used
      for a while and sometimes its pages was flushed from buffer pool.
      Added a query that does a table scan to ensure that pages are in buffer pool.
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/suite/innodb_gis/r/create_spatial_index.result
    mysql-test/suite/innodb_gis/r/rtree.result
    mysql-test/suite/innodb_gis/r/rtree_multi_pk.result
      Changes in query plans from full table/index scan to range scan
      Queries will now actually use a spatial index
    mysql-test/suite/innodb/r/temporary_table.result
    mysql-test/suite/innodb/r/temporary_table_optimization.result
    mysql-test/suite/innodb_zip/r/wl6469.result
    mysql-test/suite/innodb_zip/r/wl6560.result
      A few queries changes from table scan to range scan due to use of magic
      constants in the cost model for table scan.
    mysql-test/suite/innodb_fts/r/opt.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/suite/json/r/json_agg.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/suite/opt_trace/r/bugs_no_prot_all.result
    mysql-test/suite/opt_trace/r/bugs_ps_prot_all.result
      Updated cost estimate numbers in optimizer trace output.
      There are a few minor changes in the optimizer trace output
      and a few plan changes.
    mysql-test/suite/opt_trace/r/bugs_no_prot_none.result
    mysql-test/suite/opt_trace/r/bugs_ps_prot_none.result
    mysql-test/suite/opt_trace/r/fulltext.result
    mysql-test/suite/opt_trace/r/general2_no_prot.result
    mysql-test/suite/opt_trace/r/general2_ps_prot.result
    mysql-test/suite/opt_trace/r/general_no_prot_none.result
    mysql-test/suite/opt_trace/r/general_ps_prot_none.result
    mysql-test/suite/opt_trace/r/range_no_prot.result
    mysql-test/suite/opt_trace/r/range_ps_prot.result
      Updated cost estimate numbers in optimizer trace output.
      There are a few tiny minor change in the optimizer trace output.
    mysql-test/suite/opt_trace/r/charset.result
    mysql-test/suite/opt_trace/r/eq_range_statistics.result
    mysql-test/suite/opt_trace/r/filesort_pack.result
    mysql-test/suite/opt_trace/r/filesort_pq.result
    mysql-test/suite/opt_trace/r/general_no_prot_all.result
    mysql-test/suite/opt_trace/r/general_ps_prot_all.result
    mysql-test/suite/opt_trace/r/subquery_no_prot.result
    mysql-test/suite/opt_trace/r/subquery_ps_prot.result
    mysql-test/suite/opt_trace/r/temp_table.result
      Updated cost estimate numbers in optimizer trace output.
    mysql-test/suite/opt_trace/r/security_no_prot.result
    mysql-test/suite/opt_trace/r/security_ps_prot.result
      Updated length numbers for optimizer trace output.
    mysql-test/suite/parts/r/partition_icp.result
      Updated cost numbers in EXPLAIN JSON.
    mysql-test/suite/sysschema/r/pr_statement_performance_analyzer.result
      Changed query plans give different number for rows_examined
    mysql-test/suite/sys_vars/r/max_join_size_func.result
    mysql-test/suite/sys_vars/r/sql_big_selects_func.result
    mysql-test/suite/sys_vars/t/max_join_size_func.test
    mysql-test/suite/sys_vars/t/sql_big_selects_func.test
      Reduced value for max_join_size to make queries fail with new cost constants.
    mysql-test/suite/test_service_sql_api/r/test_sql_stmt.result
      Changed result order due to different access method
    mysql-test/suite/i_main/r/bug18932813.result
    mysql-test/suite/i_main/r/derived.result
    mysql-test/suite/i_main/r/explain_json.result
    mysql-test/suite/i_main/r/group_by.result
    mysql-test/suite/i_main/r/partition_icp.result
    mysql-test/suite/i_main/r/subquery_mat_cost_based.result
    mysql-test/suite/i_main/r/view.result
      Updated cost numbers in EXPLAIN JSON.
    .../mysql-test/suite/i_main/r/bug22671573.result
      Plan changed from table scan to range scan.
      Verified that test case still reproduce the original bug.
    .../mysql-test/suite/i_main/r/costmodel_planchange.result
      Adjust queries to still identify plan changes
    .../mysql-test/suite/i_main/t/insert.test
    .../mysql-test/suite/i_main/r/insert.result
      Added data to keep same query plan
    .../mysql-test/suite/i_main/t/subquery-bug22262843.test
    .../mysql-test/suite/i_main/r/subquery-bug22262843.result
      Added a row so that subquery materialization is still used.
    .../mysql-test/suite/i_main/t/subquery.test
    .../mysql-test/suite/i_main/r/subquery.result
      Added data to keep on query plan
      Some changes from table scan (with BNL) to ref access
      Some semijoin strategy changes that seems reasonable
    .../mysql-test/suite/i_opt_trace/include/bugs.inc
      Added analyze table to make test stable
    .../mysql-test/suite/i_opt_trace/r/bugs_no_prot.result
    .../mysql-test/suite/i_opt_trace/r/bugs_ps_prot.result
    .../mysql-test/suite/i_opt_trace/r/query_cache_trace.result
      Updated cost numbers in EXPLAIN JSON.
    .../mysql-test/suite/i_opt_trace/r/refaccess_trace.result
      One query plan goes from table scan to eq_ref
      Updated cost numbers in EXPLAIN JSON.
    
    Implemented by Olav Sandstå
Loading