mirror of
https://github.com/MariaDB/server.git
synced 2025-10-09 17:29:21 +02:00

record per key statistics on keys generated for derived tables are missing, causing a fallback to the usage of MATCHING_ROWS_IN_OTHER_TABLE in best_access_path(). This can grossly overestimate the number of rows expected during a join and cause a bad join order. This patch tries to infer a few simple things about the derived table, like when the key being created matches the group by list inside (if any) inside the derived table.
11 lines
316 B
C
11 lines
316 B
C
#ifndef OPT_GROUP_BY_CARDINALITY
|
|
#define OPT_GROUP_BY_CARDINALITY
|
|
|
|
|
|
double estimate_post_group_cardinality(JOIN *join, double join_output_card);
|
|
|
|
void infer_derived_key_statistics(st_select_lex_unit* derived,
|
|
KEY *keyinfo,
|
|
uint key_parts);
|
|
|
|
#endif
|