summaryrefslogtreecommitdiff
path: root/sql/sql_select.h
Commit message (Collapse)AuthorAgeFilesLines
* EXPLAIN FORMAT=JSON: Add support for non-merged semi-joinsSergei Petrunia2014-11-291-0/+15
|
* EXPLAIN FORMAT=JSON: Add support for single-table UPDATE/DELETE.Sergei Petrunia2014-11-281-16/+4
|
* Merge ../10.1-explain-json-r4 into 10.1Sergei Petrunia2014-11-271-1/+8
|\
| * Better commentsSergei Petrunia2014-11-211-1/+7
| |
| * Merge 10.1 (with ANALYZE) and 10.1-explain-jsonSergei Petrunia2014-08-091-0/+1
| |\
| | * MDEV-6109: EXPLAIN JSON10.1-explain-jsonSergei Petrunia2014-05-271-0/+1
| | | | | | | | | | | | | | | | | | | | | - First code, "EXPLAIN FORMAT=JSON stmt" and "ANALYZE FORMAT=JSON stmt" work for basic queries. Complex constructs (e.g subqueries, etc) not yet supported. - No test infrastructure yet
* | | Merge branch 'bb-10.1-merge' into 10.1mariadb-10.1.1Sergei Golubchik2014-10-161-1/+3
|\ \ \
| * \ \ Merge 10.0.14 into 10.1Sergei Golubchik2014-10-151-1/+3
| |\ \ \ | | |/ / | |/| |
| | * | 5.5.39 mergeSergei Golubchik2014-08-071-1/+3
| | |\ \
| | | * | MDEV-6289 : Unexpected results when querying information_schemaSergey Petrunya2014-07-231-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - When traversing JOIN_TABs with first_linear_tab/next_linear_tab(), don't forget to enter the semi-join nest when it is the first table in the join order. Failure to do so could cause e.g. I_S tables not to be filled.
* | | | | MDEV-334: Backport of UNION ALL optimization from mysql-5.7.Igor Babaev2014-10-141-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | Although the original code of mysql-5.7 was adjusted to the current MariaDB code the main ideas of the optimization were preserved.
* | | | Code cleanupSergei Petrunia2014-06-261-8/+0
| | | |
* | | | Merge bb-10.1-explain-analyze into 10.1Sergei Petrunia2014-06-251-3/+12
|\ \ \ \ | |/ / / |/| | |
| * | | MDEV-406: ANALYZE $stmt: add support for BNL join bufferingSergei Petrunia2014-06-251-0/+1
| | | |
| * | | MDEV-406: ANALYZE $stmt: get ANALYZE work for subqueriesSergei Petrunia2014-06-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - "ANALYZE $stmt" should discard select's output, but it should still evaluate the output columns (otherwise, subqueries in select list are not executed) - SHOW EXPLAIN's code practice of calling JOIN::save_explain_data() after JOIN::exec() is disastrous for ANALYZE, because it resets all counters after the first execution. It is stopped = "Late" test_if_skip_sort_order() calls explicitly update their part of the query plan. = Also, I had to rewrite I_S optimization to actually have optimization and execution stages.
| * | | MDEV-406: ANALYZE $stmtSergei Petrunia2014-06-031-1/+1
| | |/ | |/| | | | | | | | | | - Support tracking for UNIONs, temporary-table based ORDER BYs, and both.
| * | Re-commit in git:Sergei Petrunia2014-05-271-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-406: ANALYZE $stmt - Ported the old patch to new explain code - New SQL syntax (ANALYZE $stmt) - ANALYZE UPDATE/DELETE is now supported (because EXPLAIN UPDATE/DELETE is supported) - Basic counters are calculated for basic kinds of queries (still need to see what happens with join buffer, ORDER BY...LIMIT queries, etc)
* | | cleanup: remove special case from store_key::store_key(), add ↵Sergei Golubchik2014-06-091-15/+2
| | | | | | | | | | | | | | | | | | Field_blob::new_key_field (prep for MDEV-6065)
* | | revert the fix for MDEV-5898, restore the fix for MDEV-5549.Sergei Golubchik2014-06-051-0/+7
|/ / | | | | | | simplify test case for MDEV-5898
* | MDEV-5898 FOUND_ROWS() return incorrect value when using DISTINCTSergei Golubchik2014-03-191-7/+0
| | | | | | | | | | revert the fix for MDEV-5549, use a different approach.
* | Merge.Igor Babaev2014-03-191-1/+1
|\ \
| * | Fixed bug mdev-5191.Igor Babaev2014-03-181-2/+1
| | | | | | | | | | | | | | | Corrected cost estimates when a join buffer is used and the optimizer is requested to use condition selectivities.
* | | 10.0-base mergeSergei Golubchik2014-02-261-1/+2
|\ \ \
| * \ \ 5.5 mergeSergei Golubchik2014-02-251-1/+2
| |\ \ \ | | |/ / | |/| / | | |/
| | * 5.3 mergeSergei Golubchik2014-02-221-1/+2
| | |\
| | | * MDEV-5581: Server crashes in in JOIN::prepare on 2nd execution of PS with ↵Sergey Petrunya2014-02-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | materialization+semijoin - The problem was that JOIN::prepare() tried to set TABLE::maybe_null for a table in join. Non-merged semi-join tables 1) are present as join's base tables on second EXECUTE, but 2) do not yet have a TABLE object. Worked around the problem by putting mixed_implicit_grouping into JOIN object, and then passing it to JTBM tables in setup_jtbm_semi_joins().
* | | | MDEV-5314 - Compiling fails on OSX using clangSergey Vojtovich2014-02-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is port of fix for MySQL BUG#17647863. revno: 5572 revision-id: jon.hauglid@oracle.com-20131030232243-b0pw98oy72uka2sj committer: Jon Olav Hauglid <jon.hauglid@oracle.com> timestamp: Thu 2013-10-31 00:22:43 +0100 message: Bug#17647863: MYSQL DOES NOT COMPILE ON OSX 10.9 GM Rename test() macro to MY_TEST() to avoid conflict with libc++.
* | | | MDEV-5549 Wrong row counter in found_rows() resultSergei Golubchik2014-02-011-0/+7
| | | | | | | | | | | | | | | | only let filesort() count rows for SQL_CALC_ROWS if it's using priority queue
* | | | merge 10.0-base -> 10.0unknown2013-10-291-2/+2
|\ \ \ \ | |/ / /
| * | | merge 5.5->10.0-baseunknown2013-10-291-2/+2
| |\ \ \ | | |/ /
| | * | Merge 5.3->5.5unknown2013-10-291-2/+2
| | |\ \ | | | |/
| | | * MDEV-5104 crash in Item_field::used_tables with broken order bytimour@askmonty.org2013-10-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analysis: st_select_lex_unit::prepare() computes can_skip_order_by as TRUE. As a result join->prepare() gets called with order == NULL, and doesn't do name resolution for the inner ORDER clause. Due to this the prepare phase doesn't detect that the query references non-exiting function and field. Later join->optimize() calls update_used_tables() for a non-resolved Item_field, which understandably has no Field object. This call results in a crash. Solution: Resolve unnecessary ORDER BY clauses to detect if they reference non-exising objects. Then remove such clauses from the JOIN object.
* | | | 10.0-base merge (roles)Sergei Golubchik2013-10-291-0/+1
|\ \ \ \ | |/ / /
| * | | MDEV-5123 Remove duplicated conditions pushed both to join_tab->select_cond ↵timour@askmonty.org2013-10-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and join_tab->cache_select->cond for blocked joins. BNL and BNLH joins pre-filter the records from a joined table via JOIN_TAB::cache_select->cond. There is no need to re-evaluate the same conditions via JOIN_TAB::select_cond. This patch removes the duplicated conditions from the top-level conjuncts of each pushed condition. The added "Using where" in few EXPLAINs is due to taking into account tab->cache_select->cond in addition to tab->select_cond in JOIN::save_explain_data_intern.
* | | | Merge 10.0-base -> 10.0Sergey Petrunya2013-10-161-7/+47
|\ \ \ \ | |/ / /
| * | | MDEV-3798: [SHOW] EXPLAIN UPDATE/DELETESergey Petrunya2013-10-151-7/+47
| |\ \ \ | | | | | | | | | | | | | | | - Merge with 10.0-base
| | * | | MDEV-3798: EXPLAIN UPDATE/DELETESergey Petrunya2013-10-151-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | - eliminate join_save_qpf() function.
| | * | | MDEV-3798: EXPLAIN UPDATE/DELETESergey Petrunya2013-10-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | - Produce correct #rows for ORDER BY ... LIMIT N queries that take advantage of ordered index read to read only N rows.
| | * | | MDEV-3798: EXPLAIN UPDATE/DELETESergey Petrunya2013-10-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - if EXPLAIN DELETE prints "Deleting all rows", it should show the expected number of rows in the rows column.
| | * | | MDEV-3798: EXPLAIN UPDATE/DELETESergey Petrunya2013-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | - Add support for EXPLAIN INSERT.
| | * | | MDEV-3798: EXPLAIN UPDATE/DELETESergey Petrunya2013-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | - Address review feedback: rename files
| | * | | MDEV-3798: EXPLAIN UPDATE/DELETESergey Petrunya2013-10-051-5/+11
| | | | | | | | | | | | | | | | | | | | - Address review feedback: rename nearly any name used by the new EXPLAIN code.
| | * | | MDEV-5093, MDEV-5094:Sergey Petrunya2013-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | - Make EXPLAIN {PARTITIONS,EXTENDED} {UPDATE,DELETE} work.
| | * | | Code cleanupSergey Petrunya2013-09-041-1/+0
| | | | |
| | * | | [SHOW] EXPLAIN UPDATE/DELETE, code re-structuringSergey Petrunya2013-08-241-6/+36
| | |\ \ \ | | | | | | | | | | | | | | | | | | - Merge with current 10.0-base
| | | * | | [SHOW] EXPLAIN UPDATE/DELETE, code re-structuringSergey Petrunya2013-06-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Make query plan be re-saved after the first join execution (saving it after JOIN::cleanup is too late because EXPLAIN output is currently produced before that) - Handle QPF allocation/deallocation for edge cases, like unsuccessful BINLOG command. - Work around the problem with UNION's direct subselects not being visible. - Update test results ("Using temporary; Using filesort" are now always printed last in the Extra column) - This cset gets rid of memory leaks/crashes. Some result mismatches still remain.
| | | * | | Switching [EXPLAIN] UPDATE/DELETE to rely on query plan footprints.Sergey Petrunya2013-06-201-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This requires that subselect's footprints are saved before it is deleted. Attempt to save select's QPF exposes one to a variety of edge cases: - the select may be a UNION's "fake select" which has no valid id - optimization may fail in the middle (but subsequent JOIN::optimize() calls will succeed, despite the fact that there never was a query plan)
| | | * | | SHOW EXPLAIN UPDATE/DELETESergey Petrunya2013-06-171-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Introduce "Query Plan Footprints" (abbrev. QPFs) QPF is a part of query plan that is 1. sufficient to produce EXPLAIN output, 2. can be used to produce EXPLAIN output even after its subquery/union was executed and deleted 3. is cheap to save so that we can always save query plans - This patch doesn't fully address #2, we make/save strings for a number of EXPLAIN's columns. This will be fixed.
| | | * | | [SHOW] EXPLAIN UPDATE/DELETE - Merge with 10.0-baseSergey Petrunya2013-05-271-0/+22
| | | |\ \ \
| | | | * | | EXPLAIN DELETE for MariaDBSergey Petrunya2013-02-121-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Backported the code to 10.0-base - Removed incorrect assert