mariadb/plugin
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
..
audit_null Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
auth_dialog Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
auth_ed25519 Merge 10.3 into 10.4 2021-05-25 15:38:57 +03:00
auth_examples Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
auth_gssapi MDEV-26715 Windows/installer - allow passwordless login for root 2022-11-08 14:58:47 +01:00
auth_pam Merge branch '10.6' into 10.7 2022-05-11 11:25:33 +02:00
auth_pipe Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
auth_socket Early return from auth_socket system checks on Windows 2021-09-11 01:33:29 +02:00
aws_key_management Merge branch '10.4' into 10.5 2021-07-31 23:19:51 +02:00
cracklib_password_check Merge branch '10.6' into 10.7 2022-10-29 19:22:04 +02:00
daemon_example perfschema memory related instrumentation changes 2020-03-10 19:24:22 +01:00
debug_key_management Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
disks Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
example_key_management Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
feedback Merge branch '10.10' into 10.11 2022-11-02 13:08:01 +01:00
file_key_management Merge 10.3 into 10.4 2022-10-25 10:04:37 +03:00
fulltext Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
func_test MDEV-23479: Add a THD* argument to Item_func_or_sum::fix_length_and_dec() 2022-03-30 17:00:17 +05:30
handler_socket Merge 10.4 into 10.5 2022-12-13 14:39:18 +02:00
hashicorp_key_management MDEV-29986 Set innodb_undo_tablespaces=3 by default 2023-01-13 12:46:30 +02:00
locale_info MDEV-22214 mariadbd.exe calls function mysqld.exe, and crashes 2020-04-10 19:05:26 +02:00
metadata_lock_info remove mysql_declare_plugin declaration from some plugins 2020-07-04 01:44:47 +02:00
password_reuse_check Merge 10.9 into 10.10 2022-11-28 13:43:41 +02:00
provider_bzip2 SUMMARY/DESCRIPTION for compression provider RPMs 2021-12-08 14:57:37 +01:00
provider_lz4 SUMMARY/DESCRIPTION for compression provider RPMs 2021-12-08 14:57:37 +01:00
provider_lzma SUMMARY/DESCRIPTION for compression provider RPMs 2021-12-08 14:57:37 +01:00
provider_lzo SUMMARY/DESCRIPTION for compression provider RPMs 2021-12-08 14:57:37 +01:00
provider_snappy SUMMARY/DESCRIPTION for compression provider RPMs 2021-12-08 14:57:37 +01:00
qc_info MDEV-27009 Add UCA-14.0.0 collations 2022-08-10 15:04:24 +02:00
query_response_time Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
server_audit Merge branch '10.6' into 10.7 2022-05-11 11:25:33 +02:00
simple_password_check Merge branch '10.6' into 10.7 2022-08-08 17:12:32 +02:00
sql_errlog Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
test_sql_service Fixed usage of unitialised value error in test_sql_service 2022-12-20 22:34:53 +02:00
type_geom change buitin plugin types from Alpha to Stable as needed 2020-08-07 13:36:11 +02:00
type_inet Change cost for REF to take into account cost for 1 extra key read_next 2023-02-10 12:58:50 +02:00
type_mysql_json Merge 10.6 into 10.7 2022-07-27 18:26:21 +03:00
type_test Merge remote-tracking branch 'origin/10.4' into 10.5 2022-09-14 16:24:51 +04:00
type_uuid Change cost for REF to take into account cost for 1 extra key read_next 2023-02-10 12:58:50 +02:00
user_variables Merge 10.8 into 10.9 2022-09-21 10:07:09 +03:00
userstat Merge 10.4 into 10.5 2021-04-14 11:35:39 +03:00
versioning Merge 10.4 into 10.5 2022-04-06 10:06:39 +03:00
win_auth_client Vanilla cleanups and refactorings 2021-10-26 17:07:46 +02:00
wsrep_info Merge branch '10.4' into 10.5 2022-10-02 14:38:13 +02:00