mariadb/mysql-test/suite/versioning/r
Monty 3fa99f0c0e Change cost for REF to take into account cost for 1 extra key read_next
The main difference in code path between EQ_REF and REF is that for
REF we have to do an extra read_next on the index to check that there
is no more matching rows.

Before this patch we added a preference of EQ_REF by ensuring that REF
would always estimate to find at least 2 rows.

This patch adds the cost of the extra key read_next to REF access and
removes the code that limited REF to at least 2 rows. For some queries
this can have a big effect as the total estimated rows will be halved
for each REF table with 1 rows.

multi_range cost calculations are also changed to take into account
the difference between EQ_REF and REF.

The effect of the patch to the test suite:
- About 80 test case changed
- Almost all changes where for EXPLAIN where estimated rows for REF
  where changed from 2 to 1.
- A few test cases using explain extended had a change of 'filtered'.
  This is because of the estimated rows are now closer to the
  calculated selectivity.
- A very few test had a change of table order.
  This is because the change of estimated rows from 2 to 1 or the small
  cost change for REF
  (main.subselect_sj_jcl6, main.group_by, main.dervied_cond_pushdown,
  main.distinct, main.join_nested, main.order_by, main.join_cache)
- No key statistics and the estimated rows are now smaller which cased
  estimated filtering to be lower.
  (main.subselect_sj_mat)
- The number of total rows are halved.
  (main.derived_cond_pushdown)
- Plans with 1 row changed to use RANGE instead of REF.
  (main.group_min_max)
- ALL changed to REF
  (main.key_diff)
- Key changed from ref + index_only to PRIMARY key for InnoDB, as
  OPTIMIZER_ROW_LOOKUP_COST + OPTIMIZER_ROW_NEXT_FIND_COST is smaller than
  OPTIMIZER_KEY_LOOKUP_COST + OPTIMIZER_KEY_NEXT_FIND_COST.
  (main.join_outer_innodb)
- Cost changes printouts
  (main.opt_trace*)
- Result order change
  (innodb_gis.rtree)
2023-02-10 12:58:50 +02:00
..
alter.result Removed "<select expression> INTO <destination>" deprication. 2023-02-03 11:57:50 +03:00
autoinc.result
binlog.result MDEV-29732 mysqlbinlog produces syntactically incorrect output with system_versioning_insert_history 2022-10-26 15:30:38 +02:00
commit_id.result Removed "<select expression> INTO <destination>" deprication. 2023-02-03 11:57:50 +03:00
create.result Removed "<select expression> INTO <destination>" deprication. 2023-02-03 11:57:50 +03:00
cte.result Change cost for REF to take into account cost for 1 extra key read_next 2023-02-10 12:58:50 +02:00
data.result Merge branch '10.10' into 10.11 2022-11-02 13:08:01 +01:00
debug.result Merge 10.8 into 10.9 2023-01-10 14:50:58 +02:00
delete.result MDEV-25004 Missing row in FTS_DOC_ID_INDEX during DELETE HISTORY 2022-12-27 00:02:02 +03:00
delete_history.result Merge 10.8 into 10.9 2023-01-10 14:50:58 +02:00
derived.result
foreign.result Removed "<select expression> INTO <destination>" deprication. 2023-02-03 11:57:50 +03:00
insert.result Removed "<select expression> INTO <destination>" deprication. 2023-02-03 11:57:50 +03:00
insert2.result
load_data.result Removed "<select expression> INTO <destination>" deprication. 2023-02-03 11:57:50 +03:00
misc.result Merge branch '10.10' into 10.11 2022-11-02 13:08:01 +01:00
not_embedded.result MDEV-5215 prerequisite: remove test and test_* database hacks in the test suite 2022-11-01 16:33:00 +01:00
online.result
optimized.result
partition,heap.rdiff
partition.result Removed "<select expression> INTO <destination>" deprication. 2023-02-03 11:57:50 +03:00
replace.result
rpl.result MDEV-16546 post-review fixes 2022-10-26 15:30:38 +02:00
rpl_mix.result
rpl_row.result
rpl_stmt.result
select.result Removed "<select expression> INTO <destination>" deprication. 2023-02-03 11:57:50 +03:00
select2,trx_id.rdiff Removed "<select expression> INTO <destination>" deprication. 2023-02-03 11:57:50 +03:00
select2.result Removed "<select expression> INTO <destination>" deprication. 2023-02-03 11:57:50 +03:00
simple.result
sysvars.result
trx_id.result Removed "<select expression> INTO <destination>" deprication. 2023-02-03 11:57:50 +03:00
update,trx_id.rdiff Removed diff dates from rdiff files 2023-02-03 11:57:45 +03:00
update-big.result
update.result
view.result