mirror of
https://github.com/MariaDB/server.git
synced 2025-03-25 00:18:42 +01:00
![]() (Variant 3) (commit in 11.4) When a derived table has a GROUP BY clause: SELECT ... FROM (SELECT ... GROUP BY col1, col2) AS tbl The optimizer would use inner join's output cardinality as an estimate of derived table size, ignoring the fact that GROUP BY operation would produce much fewer groups. Add code to produce tighter bounds: - The GROUP BY list is split into per-table lists. If GROUP BY list has expressions that refer to multiple tables, we fall back to join output cardinality. - For each table, the first cardinality estimate is join_tab->read_records. - Then, we try to get a tighter bound by using index statistics. - If indexes do not cover all GROUP BY columns, we try to use per-column EITS statistics. |
||
---|---|---|
.. | ||
examples | ||
client_settings.h | ||
CMakeLists.txt | ||
emb_qcache.cc | ||
emb_qcache.h | ||
embedded_priv.h | ||
lib_sql.cc | ||
libmysql.c | ||
libmysqld.c | ||
libmysqld.def | ||
libmysqld.rc | ||
resource.h |