1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-24 19:42:23 +03:00
Commit Graph

186 Commits

Author SHA1 Message Date
36eba98817 MDEV-19123 Change default charset from latin1 to utf8mb4
Changing the default server character set from latin1 to utf8mb4.
2024-07-11 10:21:07 +04:00
44af9bfc67 Merge remote-tracking branch 'origin/10.11' into 11.1 2024-07-09 10:45:47 +04:00
2447dda2c0 Merge branch '10.11' into 11.1 2024-07-08 22:40:16 +02:00
4d71a117a3 Merge remote-tracking branch 'origin/10.6' into 10.11 2024-07-08 21:52:08 +04:00
e56040fee8 Merge remote-tracking branch 'origin/10.5' into 10.6 2024-07-08 18:59:04 +04:00
d1e5fa8917 MDEV-34305 Redundant truncation errors/warnings with optimizer_trace enabled
my_like_range*() can create longer keys than Field::char_length().
This caused warnings during print_range().

Fix:

Suppressing warnings in print_range().
2024-07-08 18:01:01 +04:00
034a175982 Merge branch '10.6' into 10.11 2024-07-04 11:52:07 +02:00
dcd8a64892 Merge branch '10.5' into 10.6 2024-07-03 13:27:23 +02:00
9e74a7f4f3 Removing MDEV-27871 from tastcases because it is not a bug 2024-06-28 16:45:50 +07:00
683fbced6b Merge 11.0 into 11.1 2024-03-28 12:15:36 +02:00
d73baa402a Merge 10.11 into 11.0 2024-02-20 12:02:01 +02:00
64cce8d5bf Merge 10.6 into 10.11 2024-02-14 16:12:53 +02:00
691f923906 Merge 10.5 into 10.6 2024-02-13 20:42:59 +02:00
b770633e07 Merge 10.4 into 10.5 2024-02-13 14:25:21 +02:00
ae709b64e2 fix view protocol in MDEV-29179 2024-02-13 09:24:32 +01:00
8ec12e0d6d Merge 10.4 into 10.5 2024-02-12 11:38:13 +02:00
Rex
36f51d9748 MDEV-29179 Condition pushdown from HAVING into WHERE is not shown in optimizer trace
JOIN::optimize_inner(), Condition pushdown from HAVING into WHERE
	  not shown in optimizer trace.
2024-02-11 22:21:32 +01:00
15623c7f29 MDEV-30660 Aggregation functions fail to leverage uniqueness property
When executing a statement of the form
  SELECT AGGR_FN(DISTINCT c1, c2,..,cn) FROM t1,
where AGGR_FN is an aggregate function such as COUNT(), AVG() or SUM(),
and a unique index exists on table t1 covering some or all of the
columns (c1, c2,..,cn), the retrieved values are inherently unique.
Consequently, the need for de-duplication imposed by the DISTINCT
clause can be eliminated, leading to optimization of aggregation
operations.
This optimization applies under the following conditions:
  - only one table involved in the join (not counting const tables)
  - some arguments of the aggregate function are fields
        (not functions/subqueries)

This optimization extends to queries of the form
  SELECT AGGR_FN(c1, c2,..,cn) GROUP BY cx,..cy
when a unique index covers some or all of the columns
(c1, c2,..cn, cx,..cy)
2024-02-10 14:54:03 +07:00
b6680e0101 Merge branch '11.0' into 11.1 2024-02-02 11:30:47 +01:00
9374772ecd Merge 10.11 into 11.0 2024-01-19 09:07:48 +02:00
9d20853c74 Merge 10.6 into 10.11 2024-01-18 19:22:23 +02:00
3a96eba25f Merge 10.5 into 10.6 2024-01-17 13:35:05 +02:00
48e4962c44 MDEV-29298 INSERT ... SELECT Does not produce an optimizer trace
Add INSERT ... SELECT to the list of commands that can be traced

Approved by Sergei Petrunia (sergey@mariadb.com)
2024-01-13 11:44:55 +07:00
7a5448f8da Merge branch '11.0' into 11.1 2023-12-19 20:11:54 +01:00
8c8bce05d2 Merge branch '10.11' into 11.0 2023-12-19 15:53:18 +01:00
0f5613a25f Merge branch '11.0' into 11.1 2023-11-08 18:03:08 +01:00
48af85db21 Merge branch '10.11' into 11.0 2023-11-08 17:09:44 +01:00
04d9a46c41 Merge branch '10.6' into 10.10 2023-11-08 16:23:30 +01:00
b83c379420 Merge branch '10.5' into 10.6 2023-11-08 15:57:05 +01:00
6cfd2ba397 Merge branch '10.4' into 10.5 2023-11-08 12:59:00 +01:00
68542caea1 MDEV-32475 Add logging of test_if_skip_sort_order to optimizer trace 2023-10-25 16:37:55 +07:00
f5fae75652 Merge branch '11.0' into 11.1 2023-08-09 08:25:14 +02:00
51f9d62005 Merge branch '10.11' into 11.0 2023-08-09 07:53:48 +02:00
ced243a099 Merge branch '10.9' into 10.10 2023-08-05 20:34:09 +02:00
34a8e78581 Merge branch '10.6' into 10.9 2023-08-04 08:01:06 +02:00
6bf8483cac Merge branch '10.5' into 10.6 2023-08-01 15:08:52 +02:00
f291c3df2c Merge branch '10.4' into 10.5 2023-07-27 15:43:21 +02:00
515ba857ba MDEV-31407: Add aliases in opt_trace.test for long column name for removing "--disable-view-protocol"
Change tests:
	opt_trace.test
	opt_trace_index_merge.test
	opt_trace_ucs2.test
2023-07-26 10:23:03 +07:00
f52954ef42 Merge commit '10.4' into 10.5 2023-07-20 11:54:52 +02:00
d6c6102cad MDEV-30828 Prevent pushing down unions with incorrect ORDER BY
Fake_select_lex->join was prepared at the unit execution stage so
the validation of fake_select_lex before the unit pushdown
was incomplete. That caused pushing down of statements having
an incorrect ORDER BY clause.
This commit moves preparation of the fake_select_lex->join to the unit
prepare() method, before initializing of the pushdown handler,
so incorrect clauses error out before being pushed down
2023-06-30 12:36:47 +07:00
3883eb63dc Merge 11.0 into 11.1 2023-06-08 14:09:21 +03:00
f5dceafd0b MDEV-30964: MAX_SEL_ARG memory exhaustion is not visible in the optimizer trace
Add printing
2023-06-08 14:02:34 +03:00
cb9d97ef38 Merge mariadb-11.0.2 into 11.0 2023-06-08 11:35:36 +03:00
07b02ab40e MDEV-31356: Range cost calculations does not take into account join_buffer
This patch also fixes
MDEV-31391 Assertion `((best.records_out) == 0.0 ... failed

Cost changes caused by this change:
- range queries with join buffer now have a notable smaller cost.
- range ranges are bit more expensive as the MULTI_RANGE_COST is now
  properly applied to it in all cases (this extra cost is equal to a
  key lookup).
- table scan cost is slight smaller as we now assume data is cached in
  the engine after the first scan pass. (We did this before for range
  scans and other access methods).
- partition tables had wrong values for max_row_blocks and
  max_index_blocks.  Correcting this, causes range access on
  partitioned tables to have slightly higher cost because of the
  increased estimated IO.
- Using first match + join buffer caused 'filtered' to be calcualted
  wrong.  (Only affected EXPLAIN, not query costs).
- Added cost_without_join_buffer to optimizer_trace.
- check_quick_select() adjusted the number of rows according to persistent
  statistics, but did not adjust cost. Now fixed.

The big change in the patch are:

- In best_access_path(), where we now are using storing the cost in
  'ALL_READ_COST cost' and only converting it to a double at the end.
   This allows us to more exactly calculate the effect of the join_cache.
- In JOIN_TAB::estimate_scan_time(), store the cost also in a
  ALL_READ_COST object.

One of effect if this change is that when joining very small tables:

t1    some_access_method
t2    range
t3    ALL         Use join buffer

This is swiched to

t1      some_access_method
t3      ALL
t2      range      use join buffer

Both plans has the same cost, but as table scan in this case has less
cost than rang, the table scan will be considered first and thus have
precidence.

Test case changes:
- optimizer_trace          - Addition of cost_without_join_buffer
- subselect_mat_cost_bugs  - Small tables and scan versus range
- range & range_mrr_icp    - Range + join_cache is faster than ref
- optimizer_trace          - cost_without_join_buffer, smaller scan cost,
                             range setup cost.
- mrr                      - range+join_buffer used as smaller cost
2023-06-07 18:42:58 +03:00
47e29a2ff4 MDEV-25080 Fix incorrect view names in printed queries
When printing Item_direct_view_ref the printed field name must be
complemented with the view name/derived table alias.
For example, for "SELECT a FROM (SELECT a FROM t1) q" field `a`
in the select list must be printed as `q`.`a`.

But if the view was merged then the initial `q` does not make sense
any more so field `a` must be printed  as `t1`.`a`
2023-06-05 20:16:07 +02:00
cbabb95915 Merge branch '11.0' into 11.1 2023-06-05 20:15:15 +02:00
0005f2f06c Merge branch 'bb-10.11-release' into bb-11.0-release 2023-06-05 19:27:00 +02:00
16e5bc4cbc Merge branch '10.9' into 10.10 2023-05-04 11:50:34 +02:00
d7fae797f4 Merge branch '10.8' into 10.9 2023-05-04 11:39:51 +02:00
85997115c2 Merge branch '10.6' into 10.8 2023-05-04 11:34:11 +02:00