1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

BUG#14940: Slow join order is chosen: [2nd commit with post-review fixes]

- Re-worked the prev_record_reads() function to return the lower bound of
  number of different table access scans that will be performed.


mysql-test/r/join.result:
  BUG#14940: testcase
mysql-test/t/join.test:
  BUG#14940: testcase
sql/sql_select.cc:
  BUG#14940: Slow join order is chosen: 
  - Re-worked the prev_record_reads() function to return the lower bound of
    number of different table access scans that will be performed.
sql/sql_select.h:
  BUG#14940: Slow join order is chosen:
  - Added comments in struct POSITION
  - Added POSITION::ref_depend_map: bitmap of tables that the table access
    method depends on.
This commit is contained in:
unknown
2006-09-29 15:58:47 +04:00
parent 7260fd7049
commit 5df80677a3
4 changed files with 161 additions and 13 deletions

View File

@@ -176,7 +176,13 @@ enum_nested_loop_state sub_select(JOIN *join,JOIN_TAB *join_tab, bool
*/
typedef struct st_position
{
/*
The "fanout": number of output rows that will be produced (after
pushed down selection condition is applied) per each row combination of
previous tables.
*/
double records_read;
/*
Cost accessing the table in course of the entire complete join execution,
i.e. cost of one access method use (e.g. 'range' or 'ref' scan ) times
@@ -184,7 +190,15 @@ typedef struct st_position
*/
double read_time;
JOIN_TAB *table;
/*
NULL - 'index' or 'range' or 'index_merge' or 'ALL' access is used.
Other - [eq_]ref[_or_null] access is used. Pointer to {t.keypart1 = expr}
*/
KEYUSE *key;
/* If ref-based access is used: bitmap of tables this table depends on */
table_map ref_depend_map;
} POSITION;