mariadb/libmysqld
Sergei Petrunia ef966af801 MDEV-30877: Output cardinality for derived table ignores GROUP BY
(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.
2025-02-10 22:06:49 +02:00
..
examples MDEV-33091 pcre2 headers aren't found on Solaris 2024-01-19 20:23:45 +01:00
client_settings.h Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
CMakeLists.txt MDEV-30877: Output cardinality for derived table ignores GROUP BY 2025-02-10 22:06:49 +02:00
emb_qcache.cc MDEV-27595 Backport SQL service, introduced by MDEV-19275. 2023-11-05 23:35:32 +04:00
emb_qcache.h MDEV-19275 Provide SQL service to plugins. 2020-08-14 21:04:25 +04:00
embedded_priv.h Fixed crash in connect.misc with embedded server 2024-02-27 14:55:47 +02:00
lib_sql.cc Fixed memory leaks in embedded server and mysqltest 2024-04-05 12:40:49 +02:00
libmysql.c Merge branch '11.0' into 11.1 2024-02-02 11:30:47 +01:00
libmysqld.c Fixed crash in connect.misc with embedded server 2024-02-27 14:55:47 +02:00
libmysqld.def merge with 5.3 2011-10-19 21:45:18 +02:00
libmysqld.rc query_id and my_xid -> ulonglong 2005-01-27 22:38:56 +01:00
resource.h query_id and my_xid -> ulonglong 2005-01-27 22:38:56 +01:00