summaryrefslogtreecommitdiff
path: root/sql/sql_select.h
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2022-04-11 17:59:36 +0300
committerSergei Petrunia <sergey@mariadb.com>2023-02-02 22:25:24 +0300
commit2387ee9b4556cf5f4730ea7033a30977273173ad (patch)
tree5c518a9ef3b9ec80c1533b371137aa9344c23f92 /sql/sql_select.h
parent9db877c9ec6fb048e213cc824643ed7f074d9e40 (diff)
downloadmariadb-git-2387ee9b4556cf5f4730ea7033a30977273173ad.tar.gz
Added 'records_out' and join_type to POSITION
records_out is the numbers of rows expected to be accepted from a table. records_read is in contrast the number of rows that the optimizer excepts to read from the engine. This patch causes not plan changes. The differences in test results comes from renaming "records" to "records_read" and printing of record_out in the optimizer trace. Other things: - Renamed table_cond_selectivity() to table_after_join_selectivity() to make the purpose of the function more clear.
Diffstat (limited to 'sql/sql_select.h')
-rw-r--r--sql/sql_select.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 106746b35de..ec13eecd4d6 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -343,7 +343,10 @@ typedef struct st_join_table {
/* Copy of POSITION::records_read, set by get_best_combination() */
double records_read;
-
+
+ /* Copy of POSITION::records_out, set by get_best_combination() */
+ double records_out;
+
/* The selectivity of the conditions that can be pushed to the table */
double cond_selectivity;
@@ -939,11 +942,22 @@ public:
JOIN_TAB *table;
/*
+ The number of rows that will be read from the table
+ */
+ double records_read;
+
+ /*
The "fanout": number of output rows that will be produced (after
pushed down selection condition is applied) per each row combination of
previous tables.
+
+ This takes into account table->cond_selectivity, the WHERE clause
+ related to this table calculated in
+ calculate_cond_selectivity_for_table(), and the used rowid filter but
+ does not take into account the WHERE clause involving preceding tables
+ calculated in table_after_join_selectivity().
*/
- double records_read;
+ double records_out;
/* The selectivity of the pushed down conditions */
double cond_selectivity;
@@ -1007,6 +1021,7 @@ public:
/* Type of join (EQ_REF, REF etc) */
enum join_type type;
+
/*
Valid only after fix_semijoin_strategies_for_picked_join_order() call:
if sj_strategy!=SJ_OPT_NONE, this is the number of subsequent tables that