- 24 Aug, 2023 1 commit
-
-
Rex authored
Initial support for sql standard <explicit table> expressions The <explicit table> TABLE <table or query name> is equivalent to the <query specification> SELECT * FROM <table or query name> Deal with the conflict caused by ANALYZE TABLE t1; being both a request for table statistics and analyzing an SQL statement.
-
- 07 Jun, 2023 3 commits
-
-
Monty authored
This test case exposed 2 different bugs: - When replacing a range with an index scan on a covering key in test_if_skip_sort_order() we didn't disable filtering. Filtering does not make much sense in this case. - Fixed by disabling filtering in this case. - Range_rowid_filter::fill() did not take into account that keyread could already active, which caused an assert when it tried to activate another keyread. - Fixed by remembering old keyread state at start and restoring it at end. Other things: - ha_start_keyread() allowed multiple calls. This is wrong, especially as we do no check if the index changed! I added an assert() to ensure that we don't call it there is already an active keyread. - ha_end_keyread() always called ha_extra(), even if keyread was not active. Added a check to avoid the extra call.
-
Monty authored
-
Monty authored
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
-
- 06 Jun, 2023 1 commit
-
-
Daniel Bartholomew authored
-
- 03 Jun, 2023 2 commits
-
-
Oleksandr Byelkin authored
-
Sergei Petrunia authored
This is 11.0 part of the fix: in 11.0, get_costs_for_tables() calls best_access_path() for all possible tables, for each call it saves a POSITION object with the access method and "loose_scan_pos" POSITION object. The latter is saved even if there is no possible LooseScan plan. Saving is done by copying POSITION objects which may generate a spurious UBSan error.
-
- 27 May, 2023 3 commits
-
-
Monty authored
The problem was a wrong assert. I changed it to match the code in best_access_path(). The given test case was a bit tricky for the optimizer, which first decided on using a index scan (because of force index), but then test_if_skip_sort_order() decided to use range anyway to handle distinct.
-
Monty authored
Problem was an overflow when calculating number of join cache refills.
-
Monty authored
This was caused of two minor issues: - get_quick_record_count() returned the number of rows for range with least cost, when it should have returned the minum number of rows for any range. - When changing REF to RANGE, we also changed records_out, which should not be done (number of records in the result will not change). The above change can cause a small change in row estimates where the optimizer chooses a clustered key with more rows than a range one secondary key (unlikely case).
-
- 09 May, 2023 2 commits
-
-
Sergei Petrunia authored
In Loose_scan_opt::save_to_position, initialize POSITION::firstmatch_with_join_buf.
-
Sergei Petrunia authored
The code in create_internal_tmp_table() didn't take into account that now temporary (derived) tables may have multiple indexes: - one index due to duplicate removal = In this example created by conversion of big-IN(...) into subquery = this index might be converted into a "unique constraint" if the key length is too large. - one index added by derived_with_keys optimization. Make create_internal_tmp_table() handle multiple indexes. Before this patch, use of a unique constraint was indicated in TABLE_SHARE::uniques. This was ok as unique constraint was the only index in the table. Now it's no longer the case so TABLE_SHARE::uniques is removed and replaced with an in-memory-only flag HA_UNIQUE_HASH. This patch is based on Monty's patch. Co-Author: Monty <monty@mariadb.org>
-
- 03 May, 2023 5 commits
-
-
Monty authored
-
Monty authored
This makes it easier to run test on just events.
-
Monty authored
This makes it easier to run test on just the MRG_MYISAM engine. Other things: - Renamed merge-big.test to flush_corruption.test as it does not have anything to do with merge tables.
-
Monty authored
The problem was that for merge tables without any underlaying tables the block size was 0, which the code could not handle. Fixed by ensuring that MERGE tables never have a block size of 0. Fixed also a wrong assumption of number of seeks needed to scan merge tables.
-
Monty authored
Introduces @@optimizer_switch flag: hash_join_cardinality When this option is on, use EITS statistics to produce tighter bounds for hash join output cardinality. This patch is an extension / replacement to a similar patch in 10.6 New features: - optimizer_switch hash_join_cardinality is on by default - records_out is set to fanout when HASH is used - Fixed bug in is_eits_usable: The function did not work with views
-
- 28 Apr, 2023 6 commits
-
-
Marko Mäkelä authored
rtr_ins_enlarge_mbr(): Relax the assertion that was added in commit f27e9c89 to cover also table-rebuilding DDL. We only need btr_cur->rtr_info->thr for acquiring R-tree locks, and the thread that is executing a DDL operation has exclusive access to the being-built index or the copy of the being-rebuilt table.
-
Yuchen Pei authored
Set the lock wait timeout to 1 beforehand, and reset it afterwards, to avoid lock conflict caused by opening the same table twice in case of self-reference.
-
Yuchen Pei authored
- assign spider->share early when !new_share - remove locking before spider_share_init_{sts,crd}
-
Yuchen Pei authored
Extracted out common subroutines, gave more meaningful names etc, added comments etc. Also: - Documented active servers load balancing reads, and other fields in SPIDER_SHARE etc. - Removed commented out code - Documented and refactored self-reference check - Removed some unnecessary functions - Renamed unhelpful roop_count - Refactored spider_get_{sts,crd}, where we turn get_type into an enum - Cleaned up spider_mbase_handler::show_table_status() and spider_mbase_handler::show_index()
-
Yuchen Pei authored
-
Yuchen Pei authored
-
- 27 Apr, 2023 13 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Daniel Black authored
Deb-autobakes where failing with: dh_missing: warning: usr/share/mysql/mysql-test/mysql-test-run exists in debian/tmp but is not installed to anywhere dh_missing: warning: usr/share/mysql/mysql-test/mtr exists in debian/tmp but is not installed to anywhere dh_missing: warning: usr/share/mysql/mysql-test/mariadb-test-run exists in debian/tmp but is not installed to anywhere dh_missing: warning: usr/share/mysql/mysql-test/mysql-test-run.pl exists in debian/tmp but is not installed to anywhere Add all to mariadb-test.install and remove mariadb-test.links
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Yuchen Pei authored
Applying b98375f9 instead of 9b32e4b1 for version 10.5-10.8. Applying 5075f4e0 instead of 9b32e4b1 for version 10.9+.
-
Tuukka Pasanen authored
AWK is used in autobake-debs.sh for printing information about created DEB packages. This can be rewrite with bash inner commands read and echo.
-
Tuukka Pasanen authored
AWK in used in Debian SysV-init and postinst scripts to determine is there enough space starting MariaDB database or create new database to target destination. These AWK scripts can be rewrited to use pure SH or help using Coreutils which is mandatory for usage of MariaDB currently. Reasoning behind this is to get rid of one very less used dependency
-
Daniel Black authored
Extend the portability of ANALYZE FORMAT=JSON by using the microsecond timer if cycles isn't available. Reviewer: Sergei Petrunia <sergey@mariadb.com>
-
Daniel Black authored
make the compile-time logic in my_timer_cycles() also #define MY_TIMER_ROUTINE_CYCLES to indicate which implementation it is using. Then, make my_timer_init() use MY_TIMER_ROUTINE_CYCLES. This leaves us with just one set of compile-time #if's which determine how we read time in #cycles. Reviewer (and commit message author): Sergei Petrunia <sergey@mariadb.com>
-
- 26 Apr, 2023 4 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
This fixes up commit e3f6e1c9
-