summaryrefslogtreecommitdiff
path: root/sql/opt_index_cond_pushdown.cc
Commit message (Collapse)AuthorAgeFilesLines
* de-virtualize redundantly virtual Item methodSergei Golubchik2020-09-101-2/+2
| | | | and remove a couple of useless MY_TEST's
* Replace handler::primary_key_is_clustered() with handler::pk_is_clustering_key()Monty2020-03-241-7/+5
| | | | | | | | | This was done to both simplify the code and also to be easier to handle storage engines that are clustered on some other index than the primary key. As pk_is_clustering_key() and is_clustering_key now are using only index_flags, these where removed from all storage engines.
* MDEV-21628: Index condition pushdown condition ... not used with BKASergei Petrunia2020-02-141-0/+15
| | | | | | | | | | | | | | Partitioning storage now supports MRR but doesn't support Index Condition Pushdown (aka ICP). This causes counter-intuitive query plans for queries that use BKA and conditions that depend on index fields: - If the condition refers to other tables, BKA's variant of ICP is used to handle it. - If the condition depends on this table only, the optimizer will try to use regular ICP for it, which will fail because the storage engine doesn't support ICP. Make the optimizer be smarter in the second case: if we were not able to use regular ICP, use BKA's variant of ICP..
* Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-1/+1
|\
| * Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
| |\
| | * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| | |\
| | | * Update FSF addressMichal Schorm2019-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is based on the work of Michal Schorm, rebased on the earliest MariaDB version. Th command line used to generate this diff was: find ./ -type f \ -exec sed -i -e 's/Foundation, Inc., 59 Temple Place, Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \ -exec sed -i -e 's/Foundation, Inc. 59 Temple Place.* Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \ -exec sed -i -e 's/MA.*.....-1307.*USA/MA 02110-1335 USA/g' {} \; \ -exec sed -i -e 's/Foundation, Inc., 59 Temple/Foundation, Inc., 51 Franklin/g' {} \; \ -exec sed -i -e 's/Place, Suite 330, Boston, MA.*02111-1307.*USA/Street, Fifth Floor, Boston, MA 02110-1335 USA/g' {} \; \ -exec sed -i -e 's/MA.*.....-1307/MA 02110-1335/g' {} \;
* | | | MDEV-13628: ORed condition in pushed index condition is not removed from the ↵Varun Gupta2019-05-111-9/+6
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WHERE So to push index condition for each join tab we have calculate the index condition that can be pushed and then remove this index condition from the original condition. This is done through the function make_cond_remainder. The problem is the function make_cond_remainder does not remove index condition when there is an OR operator. Fixed this by making the function make_cond_remainder to keep in mind of the OR operator. Also updated results for multiple test files which were incorrectly updated by the commit e0c1b3f24246d22e6785315f9a8448bd9a590422 code which was supposed to remove the condition present in the index condition was not getting executed when the condition had OR operator, with AND the pushed index condition was getting removed from where. This problem affects all versions starting from 5.5 but this is a performance improvement, so fixing it in 10.4
* | | Enusure that my_global.h is included firstMichael Widenius2017-08-241-0/+1
|/ / | | | | | | | | | | | | | | | | | | - Added sql/mariadb.h file that should be included first by files in sql directory, if sql_plugin.h is not used (sql_plugin.h adds SHOW variables that must be done before my_global.h is included) - Removed a lot of include my_global.h from include files - Removed include's of some files that my_global.h automatically includes - Removed duplicated include's of my_sys.h - Replaced include my_config.h with my_global.h
* | Correct FSF addressiangilfillan2017-03-101-1/+1
| |
* | MDEV-6152: Remove calls to current_thd while creating ItemMonty2015-08-271-4/+4
| | | | | | | | | | | | | | | | - Part 3: Adding mem_root to push_back() and push_front() Other things: - Added THD as an argument to some partition functions. - Added memory overflow checking for XML tag's in read_xml()
* | Stage 2 of MDEV-6152:Monty2015-08-211-6/+6
| | | | | | | | | | | | | | | | - Added mem_root to all calls to new Item - Added private method operator new(size_t size) to Item to ensure that we always use a mem_root when creating an item. This saves use once call to current_thd per Item creation
* | MDEV-8010 - Avoid sql_alloc() in Items (Patch #1)Sergey Vojtovich2015-08-211-16/+18
| | | | | | | | | | | | | | Added mandatory thd parameter to Item (and all derivative classes) constructor. Added thd parameter to all routines that may create items. Also removed "current_thd" from Item::Item. This reduced number of pthread_getspecific() calls from 290 to 177 per OLTP RO transaction.
* | MDEV-5314 - Compiling fails on OSX using clangSergey Vojtovich2014-02-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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++.
* | Push a lot of small fixes to get larger parts to compileMichael Widenius2013-05-211-2/+2
|/
* 5.3 mergeSergei Golubchik2012-02-211-2/+12
|\
| * Backport of:Sergey Petrunya2012-02-161-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | timestamp: Thu 2011-12-01 15:12:10 +0100 Fix for Bug#13430436 PERFORMANCE DEGRADATION IN SYSBENCH ON INNODB DUE TO ICP When running sysbench on InnoDB there is a performance degradation due to index condition pushdown (ICP). Several of the queries in sysbench have a WHERE condition that the optimizer uses for executing these queries as range scans. The upper and lower limit of the range scan will ensure that the WHERE condition is fulfilled. Still, the WHERE condition is part of the queries' condition and if ICP is enabled the condition will be pushed down to InnoDB as an index condition. Due to the range scan's upper and lower limits ensure that the WHERE condition is fulfilled, the pushed index condition will not filter out any records. As a result the use of ICP for these queries results in a performance overhead for sysbench. This overhead comes from using resources for determining the part of the condition that can be pushed down to InnoDB and overhead in InnoDB for executing the pushed index condition. With the default configuration for sysbench the range scans will use the primary key. This is a clustered index in InnoDB. Using ICP on a clustered index provides the lowest performance benefit since the entire record is part of the clustered index and in InnoDB it has the highest relative overhead for executing the pushed index condition. The fix for removing the overhead ICP introduces when running sysbench is to disable use of ICP when the index used by the query is a clustered index. When WL#6061 is implemented this change should be re-evaluated.
* | fix the include guards and add missing gplv2 headersSergei Golubchik2012-02-171-0/+16
| |
* | 5.3 mergeSergei Golubchik2012-01-131-0/+5
|\ \ | |/
| * Fixed LP bug #904832.Igor Babaev2011-12-181-0/+5
| | | | | | | | | | Do not perform index condition pushdown for conditions containing subqueries and stored functions.
* | 5.3->5.5 mergeSergei Golubchik2011-11-221-35/+55
|\ \ | |/
| * Fixed LP bug #886145.Igor Babaev2011-11-061-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug happened because in some cases the function JOIN::exec did not save the value of TABLE::pre_idx_push_select_cond in TABLE::select->pre_idx_push_select_cond for the sort table. Noticed and fixed a bug in the function make_cond_remainder that builds the remainder condition after extraction of an index pushdown condition from the where condition. The code erroneously assumed that the function make_cond_for_table left the value of ICP_COND_USES_INDEX_ONLY in sub-condition markers. Adjusted many result files from the regression test suite after this fix .
| * Backported the fix and the test case for bug 12822678 from the mysql-5.6 ↵Igor Babaev2011-11-011-1/+2
| | | | | | | | | | | | | | code line. Fixed a bug in select_describe. Adjusted results for affected test cases.
| * Downported InnoDB support of Index Condition Pushdown from MySQL-5.6 code line.Igor Babaev2011-05-251-27/+38
| |
* | merge with 5.3Sergei Golubchik2011-10-191-10/+18
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | sql/sql_insert.cc: CREATE ... IF NOT EXISTS may do nothing, but it is still not a failure. don't forget to my_ok it. ****** CREATE ... IF NOT EXISTS may do nothing, but it is still not a failure. don't forget to my_ok it. sql/sql_table.cc: small cleanup ****** small cleanup
| * Post-review fixes for the patch that added the code allowing to useIgor Babaev2011-01-211-11/+7
| | | | | | | | | | hash join over equi-join conditions without supporting indexes.
| * Fixed LP bug#694092.Igor Babaev2010-12-241-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | In some cases the function make_cond_for_index() was mistaken when detecting index only pushdown conditions for a table: a pushdown condition that was not index only could be marked as such. It happened because the procedure erroneously used the markers for index only conditions that remained from the calls of this function that extracted the index conditions for other tables. Fixed by erasing index only markers as soon as they are need anymore.
| * Merge MWL#121-125 DS-MRR improvements into MWL#128 Classic hash join treeSergey Petrunya2010-11-151-0/+1
| |\
| | * Merge MWL#121-124 DS-MRR support for key-ordered reads + MWL#128 BNL-Hash joinSergey Petrunya2010-11-011-0/+1
| | |\
| | | * BUG#625841: Assertion `!table || (!table->read_set || bitmap_is_setSergey Petrunya2010-09-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | - When find_all_keys() checks which table columns are needed for table scan that is done before the sorting, it should also analyze pushed index condition. This is achieved by remembering/checking pre-index-pushed condition.
| * | | MergeIgor Babaev2010-11-101-2/+5
| |\ \ \ | | |/ /
| | * | Fixed bug #54539.Igor Babaev2010-10-011-2/+5
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a possibility not to factor out the condition pushed to the access index out of the condition pushed to a joined table. This is useful for the condition pushed to the index when a hashed join buffer for BKA is employed. In this case the index condition may be false for some, but for all records with the same key. So the condition must be checked not only after index lookup, but after fetching row data as well, and it makes sense not to factor out the condition from the condition checked after reading row data, The bug happened because the condition pushed to an index always was factor out from the condition pushed to the accessed table.
* | | lots of post-merge changesSergei Golubchik2011-04-251-1/+1
| | |
* | | merge.Sergei Golubchik2010-11-251-1/+1
|/ / | | | | | | | | | | checkpoint. does not compile.
* | Fixed LP bug #668644.Igor Babaev2010-11-081-1/+1
|/ | | | | | | | | | The pushdown condition for the sorted table in a query can be complemented by the conditions from HAVING. This transformation is done in JOIN::exec pretty late after the original pushdown condition have been saved in the field pre_idx_push_select_cond for the sorted table. So this field must be updated after the inclusion of the condition from HAVING.
* Merge MWL#67: MRR Backport and BKA backport.Sergey Petrunya2009-12-221-4/+0
|
* MWL#67: MRR backportSergey Petrunya2009-12-221-0/+391
- Make index condition pushdown be controlled by an @@optimizer_switch flag, not by @@engine_condition_pushdown - Make MRR buffer size be controlled by @@mrr_buffer_size, not by @@read_rnd_buffer_size - Move parts of code to separate files - Code cleanup - Add --sorted_result to some SELECTs in tests.