You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2840 lines
131 KiB

WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
Bug#20577: Partitions: use of to_days() function leads to selection failures Problem was that the partition containing NULL values was pruned away, since '2001-01-01' < '2001-02-00' but TO_DAYS('2001-02-00') is NULL. Added the NULL partition for RANGE/LIST partitioning on TO_DAYS() function to be scanned too. Also fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it). mysql-test/include/partition_date_range.inc: Bug#20577: Partitions: use of to_days() function leads to selection failures Added include file to decrease test code duplication mysql-test/r/partition_pruning.result: Bug#20577: Partitions: use of to_days() function leads to selection failures Added test results mysql-test/r/partition_range.result: Bug#20577: Partitions: use of to_days() function leads to selection failures Updated test result. This fix adds the partition containing NULL values to the list of partitions to be scanned. mysql-test/t/partition_pruning.test: Bug#20577: Partitions: use of to_days() function leads to selection failures Added test case sql/item.h: Bug#20577: Partitions: use of to_days() function leads to selection failures Added MONOTONIC_*INCREASE_NOT_NULL values to be used by TO_DAYS. sql/item_timefunc.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Calculate the number of days as return value even for invalid dates. This is so that pruning can be used even for invalid dates. sql/opt_range.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it). sql/partition_info.h: Bug#20577: Partitions: use of to_days() function leads to selection failures Resetting ret_null_part when a single partition is to be used, this to avoid adding the NULL partition. sql/sql_partition.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Always include the NULL partition if RANGE or LIST. Use the returned value for the function for pruning, even if it is marked as NULL, so that even '2000-00-00' can be used for pruning, even if TO_DAYS('2000-00-00') is NULL. Changed == to >= in get_next_partition_id_list to avoid crash if part_iter->part_nums is not correctly setup.
16 years ago
Bug#20577: Partitions: use of to_days() function leads to selection failures Problem was that the partition containing NULL values was pruned away, since '2001-01-01' < '2001-02-00' but TO_DAYS('2001-02-00') is NULL. Added the NULL partition for RANGE/LIST partitioning on TO_DAYS() function to be scanned too. Also fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it). mysql-test/include/partition_date_range.inc: Bug#20577: Partitions: use of to_days() function leads to selection failures Added include file to decrease test code duplication mysql-test/r/partition_pruning.result: Bug#20577: Partitions: use of to_days() function leads to selection failures Added test results mysql-test/r/partition_range.result: Bug#20577: Partitions: use of to_days() function leads to selection failures Updated test result. This fix adds the partition containing NULL values to the list of partitions to be scanned. mysql-test/t/partition_pruning.test: Bug#20577: Partitions: use of to_days() function leads to selection failures Added test case sql/item.h: Bug#20577: Partitions: use of to_days() function leads to selection failures Added MONOTONIC_*INCREASE_NOT_NULL values to be used by TO_DAYS. sql/item_timefunc.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Calculate the number of days as return value even for invalid dates. This is so that pruning can be used even for invalid dates. sql/opt_range.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it). sql/partition_info.h: Bug#20577: Partitions: use of to_days() function leads to selection failures Resetting ret_null_part when a single partition is to be used, this to avoid adding the NULL partition. sql/sql_partition.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Always include the NULL partition if RANGE or LIST. Use the returned value for the function for pruning, even if it is marked as NULL, so that even '2000-00-00' can be used for pruning, even if TO_DAYS('2000-00-00') is NULL. Changed == to >= in get_next_partition_id_list to avoid crash if part_iter->part_nums is not correctly setup.
16 years ago
Bug#20577: Partitions: use of to_days() function leads to selection failures Problem was that the partition containing NULL values was pruned away, since '2001-01-01' < '2001-02-00' but TO_DAYS('2001-02-00') is NULL. Added the NULL partition for RANGE/LIST partitioning on TO_DAYS() function to be scanned too. Also fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it). mysql-test/include/partition_date_range.inc: Bug#20577: Partitions: use of to_days() function leads to selection failures Added include file to decrease test code duplication mysql-test/r/partition_pruning.result: Bug#20577: Partitions: use of to_days() function leads to selection failures Added test results mysql-test/r/partition_range.result: Bug#20577: Partitions: use of to_days() function leads to selection failures Updated test result. This fix adds the partition containing NULL values to the list of partitions to be scanned. mysql-test/t/partition_pruning.test: Bug#20577: Partitions: use of to_days() function leads to selection failures Added test case sql/item.h: Bug#20577: Partitions: use of to_days() function leads to selection failures Added MONOTONIC_*INCREASE_NOT_NULL values to be used by TO_DAYS. sql/item_timefunc.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Calculate the number of days as return value even for invalid dates. This is so that pruning can be used even for invalid dates. sql/opt_range.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it). sql/partition_info.h: Bug#20577: Partitions: use of to_days() function leads to selection failures Resetting ret_null_part when a single partition is to be used, this to avoid adding the NULL partition. sql/sql_partition.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Always include the NULL partition if RANGE or LIST. Use the returned value for the function for pruning, even if it is marked as NULL, so that even '2000-00-00' can be used for pruning, even if TO_DAYS('2000-00-00') is NULL. Changed == to >= in get_next_partition_id_list to avoid crash if part_iter->part_nums is not correctly setup.
16 years ago
Bug#20577: Partitions: use of to_days() function leads to selection failures Problem was that the partition containing NULL values was pruned away, since '2001-01-01' < '2001-02-00' but TO_DAYS('2001-02-00') is NULL. Added the NULL partition for RANGE/LIST partitioning on TO_DAYS() function to be scanned too. Also fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it). mysql-test/include/partition_date_range.inc: Bug#20577: Partitions: use of to_days() function leads to selection failures Added include file to decrease test code duplication mysql-test/r/partition_pruning.result: Bug#20577: Partitions: use of to_days() function leads to selection failures Added test results mysql-test/r/partition_range.result: Bug#20577: Partitions: use of to_days() function leads to selection failures Updated test result. This fix adds the partition containing NULL values to the list of partitions to be scanned. mysql-test/t/partition_pruning.test: Bug#20577: Partitions: use of to_days() function leads to selection failures Added test case sql/item.h: Bug#20577: Partitions: use of to_days() function leads to selection failures Added MONOTONIC_*INCREASE_NOT_NULL values to be used by TO_DAYS. sql/item_timefunc.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Calculate the number of days as return value even for invalid dates. This is so that pruning can be used even for invalid dates. sql/opt_range.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it). sql/partition_info.h: Bug#20577: Partitions: use of to_days() function leads to selection failures Resetting ret_null_part when a single partition is to be used, this to avoid adding the NULL partition. sql/sql_partition.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Always include the NULL partition if RANGE or LIST. Use the returned value for the function for pruning, even if it is marked as NULL, so that even '2000-00-00' can be used for pruning, even if TO_DAYS('2000-00-00') is NULL. Changed == to >= in get_next_partition_id_list to avoid crash if part_iter->part_nums is not correctly setup.
16 years ago
Bug#20577: Partitions: use of to_days() function leads to selection failures Problem was that the partition containing NULL values was pruned away, since '2001-01-01' < '2001-02-00' but TO_DAYS('2001-02-00') is NULL. Added the NULL partition for RANGE/LIST partitioning on TO_DAYS() function to be scanned too. Also fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it). mysql-test/include/partition_date_range.inc: Bug#20577: Partitions: use of to_days() function leads to selection failures Added include file to decrease test code duplication mysql-test/r/partition_pruning.result: Bug#20577: Partitions: use of to_days() function leads to selection failures Added test results mysql-test/r/partition_range.result: Bug#20577: Partitions: use of to_days() function leads to selection failures Updated test result. This fix adds the partition containing NULL values to the list of partitions to be scanned. mysql-test/t/partition_pruning.test: Bug#20577: Partitions: use of to_days() function leads to selection failures Added test case sql/item.h: Bug#20577: Partitions: use of to_days() function leads to selection failures Added MONOTONIC_*INCREASE_NOT_NULL values to be used by TO_DAYS. sql/item_timefunc.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Calculate the number of days as return value even for invalid dates. This is so that pruning can be used even for invalid dates. sql/opt_range.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it). sql/partition_info.h: Bug#20577: Partitions: use of to_days() function leads to selection failures Resetting ret_null_part when a single partition is to be used, this to avoid adding the NULL partition. sql/sql_partition.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Always include the NULL partition if RANGE or LIST. Use the returned value for the function for pruning, even if it is marked as NULL, so that even '2000-00-00' can be used for pruning, even if TO_DAYS('2000-00-00') is NULL. Changed == to >= in get_next_partition_id_list to avoid crash if part_iter->part_nums is not correctly setup.
16 years ago
Bug#20577: Partitions: use of to_days() function leads to selection failures Problem was that the partition containing NULL values was pruned away, since '2001-01-01' < '2001-02-00' but TO_DAYS('2001-02-00') is NULL. Added the NULL partition for RANGE/LIST partitioning on TO_DAYS() function to be scanned too. Also fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it). mysql-test/include/partition_date_range.inc: Bug#20577: Partitions: use of to_days() function leads to selection failures Added include file to decrease test code duplication mysql-test/r/partition_pruning.result: Bug#20577: Partitions: use of to_days() function leads to selection failures Added test results mysql-test/r/partition_range.result: Bug#20577: Partitions: use of to_days() function leads to selection failures Updated test result. This fix adds the partition containing NULL values to the list of partitions to be scanned. mysql-test/t/partition_pruning.test: Bug#20577: Partitions: use of to_days() function leads to selection failures Added test case sql/item.h: Bug#20577: Partitions: use of to_days() function leads to selection failures Added MONOTONIC_*INCREASE_NOT_NULL values to be used by TO_DAYS. sql/item_timefunc.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Calculate the number of days as return value even for invalid dates. This is so that pruning can be used even for invalid dates. sql/opt_range.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it). sql/partition_info.h: Bug#20577: Partitions: use of to_days() function leads to selection failures Resetting ret_null_part when a single partition is to be used, this to avoid adding the NULL partition. sql/sql_partition.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Always include the NULL partition if RANGE or LIST. Use the returned value for the function for pruning, even if it is marked as NULL, so that even '2000-00-00' can be used for pruning, even if TO_DAYS('2000-00-00') is NULL. Changed == to >= in get_next_partition_id_list to avoid crash if part_iter->part_nums is not correctly setup.
16 years ago
Bug#20577: Partitions: use of to_days() function leads to selection failures Problem was that the partition containing NULL values was pruned away, since '2001-01-01' < '2001-02-00' but TO_DAYS('2001-02-00') is NULL. Added the NULL partition for RANGE/LIST partitioning on TO_DAYS() function to be scanned too. Also fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it). mysql-test/include/partition_date_range.inc: Bug#20577: Partitions: use of to_days() function leads to selection failures Added include file to decrease test code duplication mysql-test/r/partition_pruning.result: Bug#20577: Partitions: use of to_days() function leads to selection failures Added test results mysql-test/r/partition_range.result: Bug#20577: Partitions: use of to_days() function leads to selection failures Updated test result. This fix adds the partition containing NULL values to the list of partitions to be scanned. mysql-test/t/partition_pruning.test: Bug#20577: Partitions: use of to_days() function leads to selection failures Added test case sql/item.h: Bug#20577: Partitions: use of to_days() function leads to selection failures Added MONOTONIC_*INCREASE_NOT_NULL values to be used by TO_DAYS. sql/item_timefunc.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Calculate the number of days as return value even for invalid dates. This is so that pruning can be used even for invalid dates. sql/opt_range.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it). sql/partition_info.h: Bug#20577: Partitions: use of to_days() function leads to selection failures Resetting ret_null_part when a single partition is to be used, this to avoid adding the NULL partition. sql/sql_partition.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Always include the NULL partition if RANGE or LIST. Use the returned value for the function for pruning, even if it is marked as NULL, so that even '2000-00-00' can be used for pruning, even if TO_DAYS('2000-00-00') is NULL. Changed == to >= in get_next_partition_id_list to avoid crash if part_iter->part_nums is not correctly setup.
16 years ago
Bug#20577: Partitions: use of to_days() function leads to selection failures Problem was that the partition containing NULL values was pruned away, since '2001-01-01' < '2001-02-00' but TO_DAYS('2001-02-00') is NULL. Added the NULL partition for RANGE/LIST partitioning on TO_DAYS() function to be scanned too. Also fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it). mysql-test/include/partition_date_range.inc: Bug#20577: Partitions: use of to_days() function leads to selection failures Added include file to decrease test code duplication mysql-test/r/partition_pruning.result: Bug#20577: Partitions: use of to_days() function leads to selection failures Added test results mysql-test/r/partition_range.result: Bug#20577: Partitions: use of to_days() function leads to selection failures Updated test result. This fix adds the partition containing NULL values to the list of partitions to be scanned. mysql-test/t/partition_pruning.test: Bug#20577: Partitions: use of to_days() function leads to selection failures Added test case sql/item.h: Bug#20577: Partitions: use of to_days() function leads to selection failures Added MONOTONIC_*INCREASE_NOT_NULL values to be used by TO_DAYS. sql/item_timefunc.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Calculate the number of days as return value even for invalid dates. This is so that pruning can be used even for invalid dates. sql/opt_range.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it). sql/partition_info.h: Bug#20577: Partitions: use of to_days() function leads to selection failures Resetting ret_null_part when a single partition is to be used, this to avoid adding the NULL partition. sql/sql_partition.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Always include the NULL partition if RANGE or LIST. Use the returned value for the function for pruning, even if it is marked as NULL, so that even '2000-00-00' can be used for pruning, even if TO_DAYS('2000-00-00') is NULL. Changed == to >= in get_next_partition_id_list to avoid crash if part_iter->part_nums is not correctly setup.
16 years ago
Bug#20577: Partitions: use of to_days() function leads to selection failures Problem was that the partition containing NULL values was pruned away, since '2001-01-01' < '2001-02-00' but TO_DAYS('2001-02-00') is NULL. Added the NULL partition for RANGE/LIST partitioning on TO_DAYS() function to be scanned too. Also fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it). mysql-test/include/partition_date_range.inc: Bug#20577: Partitions: use of to_days() function leads to selection failures Added include file to decrease test code duplication mysql-test/r/partition_pruning.result: Bug#20577: Partitions: use of to_days() function leads to selection failures Added test results mysql-test/r/partition_range.result: Bug#20577: Partitions: use of to_days() function leads to selection failures Updated test result. This fix adds the partition containing NULL values to the list of partitions to be scanned. mysql-test/t/partition_pruning.test: Bug#20577: Partitions: use of to_days() function leads to selection failures Added test case sql/item.h: Bug#20577: Partitions: use of to_days() function leads to selection failures Added MONOTONIC_*INCREASE_NOT_NULL values to be used by TO_DAYS. sql/item_timefunc.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Calculate the number of days as return value even for invalid dates. This is so that pruning can be used even for invalid dates. sql/opt_range.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it). sql/partition_info.h: Bug#20577: Partitions: use of to_days() function leads to selection failures Resetting ret_null_part when a single partition is to be used, this to avoid adding the NULL partition. sql/sql_partition.cc: Bug#20577: Partitions: use of to_days() function leads to selection failures Always include the NULL partition if RANGE or LIST. Use the returned value for the function for pruning, even if it is marked as NULL, so that even '2000-00-00' can be used for pruning, even if TO_DAYS('2000-00-00') is NULL. Changed == to >= in get_next_partition_id_list to avoid crash if part_iter->part_nums is not correctly setup.
16 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
WL#2985 "Partition Pruning" sql/ha_ndbcluster.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/ha_partition.cc: WL#2985 "Partition Pruning": added part_info->used_partitions initialization sql/handler.h: WL#2985 "Partition Pruning": Added function prototypes in partition_info: - Added 'used_partitions' bitmap - Added comments sql/item.h: WL#2985 "Partition Pruning": - added enum monotonicity_info - added virtual Item::get_monotonicity_info() sql/item_timefunc.cc: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/item_timefunc.h: WL#2985 "Partition Pruning": - added Item_func_to_days::get_monotonicity_info() - added Item_func_year::get_monotonicity_info() sql/opt_range.cc: WL#2985 "Partition Pruning": - Split out PARAM structure into PARAM and RANGE_OPT_PARAM part. - Added partition pruning module code. sql/opt_range.h: WL#2985 "Partition Pruning": Added prune_partitions() function declaration. This is the entry point for partition pruning module sql/sql_class.cc: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_lex.h: WL#2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_partition.cc: WL#2985 "Partition Pruning": - Added get_list_array_idx_for_endpoint and get_range_... functions to support partition pruning on "partition_field < const"-like intervals. - Added partition_info::used_partitions bitmap. - Added make_used_partitions_str function - Fixed BUG#15819 sql/sql_select.cc: WL#2985 "Partition Pruning": - Added prune_partitions() invocation right before the range analysis - Added code to handle return value from prune_partitions() - Added support for "EXPLAIN PARTITIONS SELECT ..." sql/sql_yacc.yy: #2985 "Partition Pruning": added support for "EXPLAIN PARTITIONS SELECT ..."
20 years ago
BUG#14940 "MySQL choose wrong index", v.2 - Make the range-et-al optimizer produce E(#table records after table condition is applied), - Make the join optimizer use this value, - Add "filtered" column to EXPLAIN EXTENDED to show fraction of records left after table condition is applied - Adjust test results, add comments mysql-test/r/archive_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/auto_increment.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/bdb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/bench_count_distinct.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/binlog_stm_blackhole.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/case.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/cast.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ctype_collate.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ctype_cp1250_ch.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/date_formats.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/distinct.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/fulltext.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_crypt.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_default.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_encrypt.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_gconcat.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_group.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_if.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_in.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_like.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_math.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_op.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_regexp.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_set.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_str.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_system.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_test.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_time.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/group_by.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/group_min_max.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/having.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/heap.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/heap_hash.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge_innodb.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge_ror.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/innodb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/insert_update.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/join.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/join_nested.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/key_diff.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/myisam.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ndb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/negation_elimination.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/null.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/olap.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/partition_pruning.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/query_cache.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/row.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/rpl_get_lock.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/rpl_master_pos_wait.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/select.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ssl.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ssl_compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/subselect.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/type_blob.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/union.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/varbinary.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/variables.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/view.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/ctype_cp1250_ch.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/func_like.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/group_min_max.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/index_merge_ror.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/index_merge_ror_cpk.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/join.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/partition_pruning.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column sql/opt_range.cc: BUG#14940: Make range/index_merge/group-min-max optimizer produce TABLE::quick_condition_rows - estimate of #records that will match the table condition. sql/sql_class.cc: BUG#14940: Add "filtered" column to output of EXPLAIN EXTENDED sql/sql_select.cc: BUG#14940: - Make the join optimizer to use TABLE::quick_condition_rows= = E(#table records after filtering with table condition) - Add "filtered" column to output of EXPLAIN EXTENDED sql/sql_select.h: BUG#14940: Added comments sql/table.h: BUG#14940: Added comments
20 years ago
BUG#14940 "MySQL choose wrong index", v.2 - Make the range-et-al optimizer produce E(#table records after table condition is applied), - Make the join optimizer use this value, - Add "filtered" column to EXPLAIN EXTENDED to show fraction of records left after table condition is applied - Adjust test results, add comments mysql-test/r/archive_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/auto_increment.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/bdb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/bench_count_distinct.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/binlog_stm_blackhole.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/case.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/cast.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ctype_collate.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ctype_cp1250_ch.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/date_formats.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/distinct.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/fulltext.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_crypt.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_default.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_encrypt.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_gconcat.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_group.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_if.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_in.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_like.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_math.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_op.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_regexp.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_set.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_str.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_system.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_test.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_time.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/group_by.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/group_min_max.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/having.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/heap.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/heap_hash.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge_innodb.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge_ror.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/innodb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/insert_update.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/join.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/join_nested.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/key_diff.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/myisam.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ndb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/negation_elimination.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/null.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/olap.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/partition_pruning.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/query_cache.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/row.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/rpl_get_lock.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/rpl_master_pos_wait.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/select.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ssl.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ssl_compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/subselect.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/type_blob.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/union.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/varbinary.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/variables.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/view.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/ctype_cp1250_ch.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/func_like.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/group_min_max.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/index_merge_ror.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/index_merge_ror_cpk.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/join.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/partition_pruning.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column sql/opt_range.cc: BUG#14940: Make range/index_merge/group-min-max optimizer produce TABLE::quick_condition_rows - estimate of #records that will match the table condition. sql/sql_class.cc: BUG#14940: Add "filtered" column to output of EXPLAIN EXTENDED sql/sql_select.cc: BUG#14940: - Make the join optimizer to use TABLE::quick_condition_rows= = E(#table records after filtering with table condition) - Add "filtered" column to output of EXPLAIN EXTENDED sql/sql_select.h: BUG#14940: Added comments sql/table.h: BUG#14940: Added comments
20 years ago
BUG#14940 "MySQL choose wrong index", v.2 - Make the range-et-al optimizer produce E(#table records after table condition is applied), - Make the join optimizer use this value, - Add "filtered" column to EXPLAIN EXTENDED to show fraction of records left after table condition is applied - Adjust test results, add comments mysql-test/r/archive_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/auto_increment.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/bdb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/bench_count_distinct.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/binlog_stm_blackhole.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/case.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/cast.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ctype_collate.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ctype_cp1250_ch.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/date_formats.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/distinct.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/fulltext.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_crypt.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_default.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_encrypt.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_gconcat.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_group.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_if.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_in.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_like.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_math.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_op.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_regexp.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_set.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_str.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_system.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_test.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_time.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/group_by.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/group_min_max.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/having.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/heap.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/heap_hash.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge_innodb.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge_ror.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/innodb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/insert_update.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/join.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/join_nested.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/key_diff.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/myisam.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ndb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/negation_elimination.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/null.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/olap.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/partition_pruning.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/query_cache.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/row.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/rpl_get_lock.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/rpl_master_pos_wait.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/select.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ssl.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ssl_compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/subselect.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/type_blob.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/union.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/varbinary.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/variables.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/view.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/ctype_cp1250_ch.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/func_like.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/group_min_max.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/index_merge_ror.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/index_merge_ror_cpk.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/join.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/partition_pruning.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column sql/opt_range.cc: BUG#14940: Make range/index_merge/group-min-max optimizer produce TABLE::quick_condition_rows - estimate of #records that will match the table condition. sql/sql_class.cc: BUG#14940: Add "filtered" column to output of EXPLAIN EXTENDED sql/sql_select.cc: BUG#14940: - Make the join optimizer to use TABLE::quick_condition_rows= = E(#table records after filtering with table condition) - Add "filtered" column to output of EXPLAIN EXTENDED sql/sql_select.h: BUG#14940: Added comments sql/table.h: BUG#14940: Added comments
20 years ago
BUG#14940 "MySQL choose wrong index", v.2 - Make the range-et-al optimizer produce E(#table records after table condition is applied), - Make the join optimizer use this value, - Add "filtered" column to EXPLAIN EXTENDED to show fraction of records left after table condition is applied - Adjust test results, add comments mysql-test/r/archive_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/auto_increment.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/bdb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/bench_count_distinct.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/binlog_stm_blackhole.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/case.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/cast.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ctype_collate.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ctype_cp1250_ch.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/date_formats.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/distinct.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/fulltext.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_crypt.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_default.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_encrypt.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_gconcat.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_group.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_if.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_in.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_like.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_math.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_op.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_regexp.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_set.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_str.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_system.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_test.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_time.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/group_by.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/group_min_max.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/having.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/heap.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/heap_hash.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge_innodb.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge_ror.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/innodb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/insert_update.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/join.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/join_nested.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/key_diff.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/myisam.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ndb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/negation_elimination.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/null.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/olap.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/partition_pruning.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/query_cache.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/row.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/rpl_get_lock.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/rpl_master_pos_wait.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/select.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ssl.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ssl_compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/subselect.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/type_blob.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/union.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/varbinary.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/variables.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/view.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/ctype_cp1250_ch.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/func_like.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/group_min_max.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/index_merge_ror.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/index_merge_ror_cpk.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/join.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/partition_pruning.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column sql/opt_range.cc: BUG#14940: Make range/index_merge/group-min-max optimizer produce TABLE::quick_condition_rows - estimate of #records that will match the table condition. sql/sql_class.cc: BUG#14940: Add "filtered" column to output of EXPLAIN EXTENDED sql/sql_select.cc: BUG#14940: - Make the join optimizer to use TABLE::quick_condition_rows= = E(#table records after filtering with table condition) - Add "filtered" column to output of EXPLAIN EXTENDED sql/sql_select.h: BUG#14940: Added comments sql/table.h: BUG#14940: Added comments
20 years ago
BUG#14940 "MySQL choose wrong index", v.2 - Make the range-et-al optimizer produce E(#table records after table condition is applied), - Make the join optimizer use this value, - Add "filtered" column to EXPLAIN EXTENDED to show fraction of records left after table condition is applied - Adjust test results, add comments mysql-test/r/archive_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/auto_increment.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/bdb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/bench_count_distinct.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/binlog_stm_blackhole.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/case.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/cast.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ctype_collate.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ctype_cp1250_ch.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/date_formats.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/distinct.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/fulltext.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_crypt.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_default.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_encrypt.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_gconcat.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_group.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_if.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_in.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_like.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_math.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_op.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_regexp.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_set.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_str.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_system.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_test.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_time.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/group_by.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/group_min_max.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/having.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/heap.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/heap_hash.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge_innodb.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge_ror.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/innodb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/insert_update.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/join.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/join_nested.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/key_diff.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/myisam.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ndb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/negation_elimination.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/null.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/olap.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/partition_pruning.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/query_cache.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/row.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/rpl_get_lock.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/rpl_master_pos_wait.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/select.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ssl.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ssl_compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/subselect.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/type_blob.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/union.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/varbinary.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/variables.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/view.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/ctype_cp1250_ch.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/func_like.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/group_min_max.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/index_merge_ror.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/index_merge_ror_cpk.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/join.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/partition_pruning.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column sql/opt_range.cc: BUG#14940: Make range/index_merge/group-min-max optimizer produce TABLE::quick_condition_rows - estimate of #records that will match the table condition. sql/sql_class.cc: BUG#14940: Add "filtered" column to output of EXPLAIN EXTENDED sql/sql_select.cc: BUG#14940: - Make the join optimizer to use TABLE::quick_condition_rows= = E(#table records after filtering with table condition) - Add "filtered" column to output of EXPLAIN EXTENDED sql/sql_select.h: BUG#14940: Added comments sql/table.h: BUG#14940: Added comments
20 years ago
BUG#14940 "MySQL choose wrong index", v.2 - Make the range-et-al optimizer produce E(#table records after table condition is applied), - Make the join optimizer use this value, - Add "filtered" column to EXPLAIN EXTENDED to show fraction of records left after table condition is applied - Adjust test results, add comments mysql-test/r/archive_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/auto_increment.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/bdb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/bench_count_distinct.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/binlog_stm_blackhole.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/case.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/cast.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ctype_collate.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ctype_cp1250_ch.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/date_formats.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/distinct.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/fulltext.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_crypt.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_default.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_encrypt.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_gconcat.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_group.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_if.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_in.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_like.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_math.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_op.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_regexp.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_set.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_str.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_system.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_test.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_time.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/group_by.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/group_min_max.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/having.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/heap.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/heap_hash.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge_innodb.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge_ror.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/innodb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/insert_update.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/join.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/join_nested.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/key_diff.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/myisam.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ndb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/negation_elimination.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/null.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/olap.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/partition_pruning.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/query_cache.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/row.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/rpl_get_lock.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/rpl_master_pos_wait.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/select.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ssl.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ssl_compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/subselect.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/type_blob.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/union.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/varbinary.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/variables.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/view.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/ctype_cp1250_ch.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/func_like.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/group_min_max.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/index_merge_ror.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/index_merge_ror_cpk.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/join.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/partition_pruning.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column sql/opt_range.cc: BUG#14940: Make range/index_merge/group-min-max optimizer produce TABLE::quick_condition_rows - estimate of #records that will match the table condition. sql/sql_class.cc: BUG#14940: Add "filtered" column to output of EXPLAIN EXTENDED sql/sql_select.cc: BUG#14940: - Make the join optimizer to use TABLE::quick_condition_rows= = E(#table records after filtering with table condition) - Add "filtered" column to output of EXPLAIN EXTENDED sql/sql_select.h: BUG#14940: Added comments sql/table.h: BUG#14940: Added comments
20 years ago
BUG#14940 "MySQL choose wrong index", v.2 - Make the range-et-al optimizer produce E(#table records after table condition is applied), - Make the join optimizer use this value, - Add "filtered" column to EXPLAIN EXTENDED to show fraction of records left after table condition is applied - Adjust test results, add comments mysql-test/r/archive_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/auto_increment.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/bdb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/bench_count_distinct.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/binlog_stm_blackhole.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/case.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/cast.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ctype_collate.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ctype_cp1250_ch.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/date_formats.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/distinct.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/fulltext.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_crypt.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_default.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_encrypt.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_gconcat.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_group.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_if.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_in.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_like.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_math.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_op.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_regexp.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_set.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_str.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_system.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_test.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_time.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/group_by.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/group_min_max.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/having.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/heap.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/heap_hash.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge_innodb.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge_ror.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/innodb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/insert_update.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/join.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/join_nested.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/key_diff.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/myisam.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ndb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/negation_elimination.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/null.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/olap.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/partition_pruning.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/query_cache.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/row.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/rpl_get_lock.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/rpl_master_pos_wait.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/select.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ssl.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ssl_compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/subselect.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/type_blob.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/union.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/varbinary.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/variables.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/view.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/ctype_cp1250_ch.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/func_like.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/group_min_max.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/index_merge_ror.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/index_merge_ror_cpk.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/join.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/partition_pruning.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column sql/opt_range.cc: BUG#14940: Make range/index_merge/group-min-max optimizer produce TABLE::quick_condition_rows - estimate of #records that will match the table condition. sql/sql_class.cc: BUG#14940: Add "filtered" column to output of EXPLAIN EXTENDED sql/sql_select.cc: BUG#14940: - Make the join optimizer to use TABLE::quick_condition_rows= = E(#table records after filtering with table condition) - Add "filtered" column to output of EXPLAIN EXTENDED sql/sql_select.h: BUG#14940: Added comments sql/table.h: BUG#14940: Added comments
20 years ago
BUG#14940 "MySQL choose wrong index", v.2 - Make the range-et-al optimizer produce E(#table records after table condition is applied), - Make the join optimizer use this value, - Add "filtered" column to EXPLAIN EXTENDED to show fraction of records left after table condition is applied - Adjust test results, add comments mysql-test/r/archive_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/auto_increment.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/bdb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/bench_count_distinct.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/binlog_stm_blackhole.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/case.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/cast.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ctype_collate.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ctype_cp1250_ch.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/date_formats.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/distinct.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/fulltext.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_crypt.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_default.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_encrypt.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_gconcat.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_group.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_if.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_in.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_like.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_math.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_op.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_regexp.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_set.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_str.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_system.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_test.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/func_time.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/group_by.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/group_min_max.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/having.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/heap.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/heap_hash.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge_innodb.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/index_merge_ror.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/innodb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/insert_update.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/join.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/join_nested.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/key_diff.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/myisam.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ndb_gis.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/negation_elimination.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/null.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/olap.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/partition_pruning.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/query_cache.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/row.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/rpl_get_lock.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/rpl_master_pos_wait.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/select.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ssl.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/ssl_compress.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/subselect.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/type_blob.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/union.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/varbinary.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/variables.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/r/view.result: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/ctype_cp1250_ch.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/func_like.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/group_min_max.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/index_merge_ror.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/index_merge_ror_cpk.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/join.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column mysql-test/t/partition_pruning.test: BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column sql/opt_range.cc: BUG#14940: Make range/index_merge/group-min-max optimizer produce TABLE::quick_condition_rows - estimate of #records that will match the table condition. sql/sql_class.cc: BUG#14940: Add "filtered" column to output of EXPLAIN EXTENDED sql/sql_select.cc: BUG#14940: - Make the join optimizer to use TABLE::quick_condition_rows= = E(#table records after filtering with table condition) - Add "filtered" column to output of EXPLAIN EXTENDED sql/sql_select.h: BUG#14940: Added comments sql/table.h: BUG#14940: Added comments
20 years ago
18 years ago
18 years ago
19 years ago
BUG#27927:Partition pruning not optimal with TO_DAYS and YEAR functions - Introduced val_int_endpoint() function which converts between func argument intervals and func value intervals for monotonic functions. - Made partition interval analyzer use part_expr->val_int_endpoint() to check if the edge values should be included. mysql-test/r/partition_pruning.result: BUG#27927: Partition pruning not optimal with TO_DAYS and YEAR functions - Testcase mysql-test/t/partition_pruning.test: BUG#27927: Partition pruning not optimal with TO_DAYS and YEAR functions - Testcase sql/item.cc: BUG#27927: Partition pruning not optimal with TO_DAYS and YEAR functions - Added Item_field::val_int_endpoint() implementation sql/item.h: BUG#27927: Partition pruning not optimal with TO_DAYS and YEAR functions - Added Item::val_int_endpoint() which converts intervals from argument space to function value space for unary monotonic functions. sql/item_timefunc.cc: BUG#27927: Partition pruning not optimal with TO_DAYS and YEAR functions - Added val_int_endpoint() for TO_DAYS and YEAR functions. sql/item_timefunc.h: BUG#27927: Partition pruning not optimal with TO_DAYS and YEAR functions - Added val_int_endpoint() for TO_DAYS and YEAR functions. sql/partition_info.h: BUG#27927: Partition pruning not optimal with TO_DAYS and YEAR functions - Removed partition_info::range_analysis_include_bounds as it is no longer needed. sql/sql_partition.cc: BUG#27927: Partition pruning not optimal with TO_DAYS and YEAR functions - Make partition interval analyzer use part_expr->val_int_endpoint() to check if the edge values should be included.
18 years ago
  1. drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
  2. #
  3. # Bug#49742: Partition Pruning not working correctly for RANGE
  4. #
  5. CREATE TABLE t1 (a INT PRIMARY KEY)
  6. PARTITION BY RANGE (a) (
  7. PARTITION p0 VALUES LESS THAN (1),
  8. PARTITION p1 VALUES LESS THAN (2),
  9. PARTITION p2 VALUES LESS THAN (3),
  10. PARTITION p3 VALUES LESS THAN (4),
  11. PARTITION p4 VALUES LESS THAN (5),
  12. PARTITION p5 VALUES LESS THAN (6),
  13. PARTITION max VALUES LESS THAN MAXVALUE);
  14. INSERT INTO t1 VALUES (-1),(0),(1),(2),(3),(4),(5),(6),(7),(8);
  15. SELECT * FROM t1 WHERE a < 1;
  16. a
  17. -1
  18. 0
  19. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 1;
  20. id select_type table partitions type possible_keys key key_len ref rows Extra
  21. 1 SIMPLE t1 p0 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index
  22. SELECT * FROM t1 WHERE a < 2;
  23. a
  24. -1
  25. 0
  26. 1
  27. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 2;
  28. id select_type table partitions type possible_keys key key_len ref rows Extra
  29. 1 SIMPLE t1 p0,p1 index PRIMARY PRIMARY 4 NULL 3 Using where; Using index
  30. SELECT * FROM t1 WHERE a < 3;
  31. a
  32. -1
  33. 0
  34. 1
  35. 2
  36. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 3;
  37. id select_type table partitions type possible_keys key key_len ref rows Extra
  38. 1 SIMPLE t1 p0,p1,p2 index PRIMARY PRIMARY 4 NULL 4 Using where; Using index
  39. SELECT * FROM t1 WHERE a < 4;
  40. a
  41. -1
  42. 0
  43. 1
  44. 2
  45. 3
  46. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 4;
  47. id select_type table partitions type possible_keys key key_len ref rows Extra
  48. 1 SIMPLE t1 p0,p1,p2,p3 index PRIMARY PRIMARY 4 NULL 5 Using where; Using index
  49. SELECT * FROM t1 WHERE a < 5;
  50. a
  51. -1
  52. 0
  53. 1
  54. 2
  55. 3
  56. 4
  57. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 5;
  58. id select_type table partitions type possible_keys key key_len ref rows Extra
  59. 1 SIMPLE t1 p0,p1,p2,p3,p4 index PRIMARY PRIMARY 4 NULL 6 Using where; Using index
  60. SELECT * FROM t1 WHERE a < 6;
  61. a
  62. -1
  63. 0
  64. 1
  65. 2
  66. 3
  67. 4
  68. 5
  69. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 6;
  70. id select_type table partitions type possible_keys key key_len ref rows Extra
  71. 1 SIMPLE t1 p0,p1,p2,p3,p4,p5 index PRIMARY PRIMARY 4 NULL 7 Using where; Using index
  72. SELECT * FROM t1 WHERE a < 7;
  73. a
  74. -1
  75. 0
  76. 1
  77. 2
  78. 3
  79. 4
  80. 5
  81. 6
  82. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 7;
  83. id select_type table partitions type possible_keys key key_len ref rows Extra
  84. 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,max range PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  85. SELECT * FROM t1 WHERE a <= 1;
  86. a
  87. -1
  88. 0
  89. 1
  90. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 1;
  91. id select_type table partitions type possible_keys key key_len ref rows Extra
  92. 1 SIMPLE t1 p0,p1 index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  93. SELECT * FROM t1 WHERE a <= 2;
  94. a
  95. -1
  96. 0
  97. 1
  98. 2
  99. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 2;
  100. id select_type table partitions type possible_keys key key_len ref rows Extra
  101. 1 SIMPLE t1 p0,p1,p2 index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  102. SELECT * FROM t1 WHERE a <= 3;
  103. a
  104. -1
  105. 0
  106. 1
  107. 2
  108. 3
  109. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 3;
  110. id select_type table partitions type possible_keys key key_len ref rows Extra
  111. 1 SIMPLE t1 p0,p1,p2,p3 index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  112. SELECT * FROM t1 WHERE a <= 4;
  113. a
  114. -1
  115. 0
  116. 1
  117. 2
  118. 3
  119. 4
  120. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 4;
  121. id select_type table partitions type possible_keys key key_len ref rows Extra
  122. 1 SIMPLE t1 p0,p1,p2,p3,p4 index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  123. SELECT * FROM t1 WHERE a <= 5;
  124. a
  125. -1
  126. 0
  127. 1
  128. 2
  129. 3
  130. 4
  131. 5
  132. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 5;
  133. id select_type table partitions type possible_keys key key_len ref rows Extra
  134. 1 SIMPLE t1 p0,p1,p2,p3,p4,p5 index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  135. SELECT * FROM t1 WHERE a <= 6;
  136. a
  137. -1
  138. 0
  139. 1
  140. 2
  141. 3
  142. 4
  143. 5
  144. 6
  145. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 6;
  146. id select_type table partitions type possible_keys key key_len ref rows Extra
  147. 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,max range PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  148. SELECT * FROM t1 WHERE a <= 7;
  149. a
  150. -1
  151. 0
  152. 1
  153. 2
  154. 3
  155. 4
  156. 5
  157. 6
  158. 7
  159. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 7;
  160. id select_type table partitions type possible_keys key key_len ref rows Extra
  161. 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,max range PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  162. SELECT * FROM t1 WHERE a = 1;
  163. a
  164. 1
  165. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 1;
  166. id select_type table partitions type possible_keys key key_len ref rows Extra
  167. 1 SIMPLE t1 p1 system PRIMARY NULL NULL NULL 1
  168. SELECT * FROM t1 WHERE a = 2;
  169. a
  170. 2
  171. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 2;
  172. id select_type table partitions type possible_keys key key_len ref rows Extra
  173. 1 SIMPLE t1 p2 system PRIMARY NULL NULL NULL 1
  174. SELECT * FROM t1 WHERE a = 3;
  175. a
  176. 3
  177. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 3;
  178. id select_type table partitions type possible_keys key key_len ref rows Extra
  179. 1 SIMPLE t1 p3 system PRIMARY NULL NULL NULL 1
  180. SELECT * FROM t1 WHERE a = 4;
  181. a
  182. 4
  183. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 4;
  184. id select_type table partitions type possible_keys key key_len ref rows Extra
  185. 1 SIMPLE t1 p4 system PRIMARY NULL NULL NULL 1
  186. SELECT * FROM t1 WHERE a = 5;
  187. a
  188. 5
  189. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 5;
  190. id select_type table partitions type possible_keys key key_len ref rows Extra
  191. 1 SIMPLE t1 p5 system PRIMARY NULL NULL NULL 1
  192. SELECT * FROM t1 WHERE a = 6;
  193. a
  194. 6
  195. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 6;
  196. id select_type table partitions type possible_keys key key_len ref rows Extra
  197. 1 SIMPLE t1 max const PRIMARY PRIMARY 4 const 1 Using index
  198. SELECT * FROM t1 WHERE a = 7;
  199. a
  200. 7
  201. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 7;
  202. id select_type table partitions type possible_keys key key_len ref rows Extra
  203. 1 SIMPLE t1 max const PRIMARY PRIMARY 4 const 1 Using index
  204. SELECT * FROM t1 WHERE a >= 1;
  205. a
  206. 1
  207. 2
  208. 3
  209. 4
  210. 5
  211. 6
  212. 7
  213. 8
  214. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 1;
  215. id select_type table partitions type possible_keys key key_len ref rows Extra
  216. 1 SIMPLE t1 p1,p2,p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  217. SELECT * FROM t1 WHERE a >= 2;
  218. a
  219. 2
  220. 3
  221. 4
  222. 5
  223. 6
  224. 7
  225. 8
  226. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 2;
  227. id select_type table partitions type possible_keys key key_len ref rows Extra
  228. 1 SIMPLE t1 p2,p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  229. SELECT * FROM t1 WHERE a >= 3;
  230. a
  231. 3
  232. 4
  233. 5
  234. 6
  235. 7
  236. 8
  237. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 3;
  238. id select_type table partitions type possible_keys key key_len ref rows Extra
  239. 1 SIMPLE t1 p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  240. SELECT * FROM t1 WHERE a >= 4;
  241. a
  242. 4
  243. 5
  244. 6
  245. 7
  246. 8
  247. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 4;
  248. id select_type table partitions type possible_keys key key_len ref rows Extra
  249. 1 SIMPLE t1 p4,p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  250. SELECT * FROM t1 WHERE a >= 5;
  251. a
  252. 5
  253. 6
  254. 7
  255. 8
  256. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 5;
  257. id select_type table partitions type possible_keys key key_len ref rows Extra
  258. 1 SIMPLE t1 p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  259. SELECT * FROM t1 WHERE a >= 6;
  260. a
  261. 6
  262. 7
  263. 8
  264. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 6;
  265. id select_type table partitions type possible_keys key key_len ref rows Extra
  266. 1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  267. SELECT * FROM t1 WHERE a >= 7;
  268. a
  269. 7
  270. 8
  271. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 7;
  272. id select_type table partitions type possible_keys key key_len ref rows Extra
  273. 1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  274. SELECT * FROM t1 WHERE a > 1;
  275. a
  276. 2
  277. 3
  278. 4
  279. 5
  280. 6
  281. 7
  282. 8
  283. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 1;
  284. id select_type table partitions type possible_keys key key_len ref rows Extra
  285. 1 SIMPLE t1 p2,p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  286. SELECT * FROM t1 WHERE a > 2;
  287. a
  288. 3
  289. 4
  290. 5
  291. 6
  292. 7
  293. 8
  294. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 2;
  295. id select_type table partitions type possible_keys key key_len ref rows Extra
  296. 1 SIMPLE t1 p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  297. SELECT * FROM t1 WHERE a > 3;
  298. a
  299. 4
  300. 5
  301. 6
  302. 7
  303. 8
  304. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 3;
  305. id select_type table partitions type possible_keys key key_len ref rows Extra
  306. 1 SIMPLE t1 p4,p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  307. SELECT * FROM t1 WHERE a > 4;
  308. a
  309. 5
  310. 6
  311. 7
  312. 8
  313. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 4;
  314. id select_type table partitions type possible_keys key key_len ref rows Extra
  315. 1 SIMPLE t1 p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  316. SELECT * FROM t1 WHERE a > 5;
  317. a
  318. 6
  319. 7
  320. 8
  321. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 5;
  322. id select_type table partitions type possible_keys key key_len ref rows Extra
  323. 1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  324. SELECT * FROM t1 WHERE a > 6;
  325. a
  326. 7
  327. 8
  328. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 6;
  329. id select_type table partitions type possible_keys key key_len ref rows Extra
  330. 1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  331. SELECT * FROM t1 WHERE a > 7;
  332. a
  333. 8
  334. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 7;
  335. id select_type table partitions type possible_keys key key_len ref rows Extra
  336. 1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
  337. DROP TABLE t1;
  338. CREATE TABLE t1 (a INT PRIMARY KEY)
  339. PARTITION BY RANGE (a) (
  340. PARTITION p0 VALUES LESS THAN (1),
  341. PARTITION p1 VALUES LESS THAN (2),
  342. PARTITION p2 VALUES LESS THAN (3),
  343. PARTITION p3 VALUES LESS THAN (4),
  344. PARTITION p4 VALUES LESS THAN (5),
  345. PARTITION max VALUES LESS THAN MAXVALUE);
  346. INSERT INTO t1 VALUES (-1),(0),(1),(2),(3),(4),(5),(6),(7);
  347. SELECT * FROM t1 WHERE a < 1;
  348. a
  349. -1
  350. 0
  351. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 1;
  352. id select_type table partitions type possible_keys key key_len ref rows Extra
  353. 1 SIMPLE t1 p0 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index
  354. SELECT * FROM t1 WHERE a < 2;
  355. a
  356. -1
  357. 0
  358. 1
  359. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 2;
  360. id select_type table partitions type possible_keys key key_len ref rows Extra
  361. 1 SIMPLE t1 p0,p1 index PRIMARY PRIMARY 4 NULL 3 Using where; Using index
  362. SELECT * FROM t1 WHERE a < 3;
  363. a
  364. -1
  365. 0
  366. 1
  367. 2
  368. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 3;
  369. id select_type table partitions type possible_keys key key_len ref rows Extra
  370. 1 SIMPLE t1 p0,p1,p2 index PRIMARY PRIMARY 4 NULL 4 Using where; Using index
  371. SELECT * FROM t1 WHERE a < 4;
  372. a
  373. -1
  374. 0
  375. 1
  376. 2
  377. 3
  378. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 4;
  379. id select_type table partitions type possible_keys key key_len ref rows Extra
  380. 1 SIMPLE t1 p0,p1,p2,p3 index PRIMARY PRIMARY 4 NULL 5 Using where; Using index
  381. SELECT * FROM t1 WHERE a < 5;
  382. a
  383. -1
  384. 0
  385. 1
  386. 2
  387. 3
  388. 4
  389. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 5;
  390. id select_type table partitions type possible_keys key key_len ref rows Extra
  391. 1 SIMPLE t1 p0,p1,p2,p3,p4 index PRIMARY PRIMARY 4 NULL 6 Using where; Using index
  392. SELECT * FROM t1 WHERE a < 6;
  393. a
  394. -1
  395. 0
  396. 1
  397. 2
  398. 3
  399. 4
  400. 5
  401. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 6;
  402. id select_type table partitions type possible_keys key key_len ref rows Extra
  403. 1 SIMPLE t1 p0,p1,p2,p3,p4,max range PRIMARY PRIMARY 4 NULL 8 Using where; Using index
  404. SELECT * FROM t1 WHERE a <= 1;
  405. a
  406. -1
  407. 0
  408. 1
  409. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 1;
  410. id select_type table partitions type possible_keys key key_len ref rows Extra
  411. 1 SIMPLE t1 p0,p1 index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  412. SELECT * FROM t1 WHERE a <= 2;
  413. a
  414. -1
  415. 0
  416. 1
  417. 2
  418. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 2;
  419. id select_type table partitions type possible_keys key key_len ref rows Extra
  420. 1 SIMPLE t1 p0,p1,p2 index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  421. SELECT * FROM t1 WHERE a <= 3;
  422. a
  423. -1
  424. 0
  425. 1
  426. 2
  427. 3
  428. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 3;
  429. id select_type table partitions type possible_keys key key_len ref rows Extra
  430. 1 SIMPLE t1 p0,p1,p2,p3 index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  431. SELECT * FROM t1 WHERE a <= 4;
  432. a
  433. -1
  434. 0
  435. 1
  436. 2
  437. 3
  438. 4
  439. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 4;
  440. id select_type table partitions type possible_keys key key_len ref rows Extra
  441. 1 SIMPLE t1 p0,p1,p2,p3,p4 index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  442. SELECT * FROM t1 WHERE a <= 5;
  443. a
  444. -1
  445. 0
  446. 1
  447. 2
  448. 3
  449. 4
  450. 5
  451. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 5;
  452. id select_type table partitions type possible_keys key key_len ref rows Extra
  453. 1 SIMPLE t1 p0,p1,p2,p3,p4,max range PRIMARY PRIMARY 4 NULL 8 Using where; Using index
  454. SELECT * FROM t1 WHERE a <= 6;
  455. a
  456. -1
  457. 0
  458. 1
  459. 2
  460. 3
  461. 4
  462. 5
  463. 6
  464. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 6;
  465. id select_type table partitions type possible_keys key key_len ref rows Extra
  466. 1 SIMPLE t1 p0,p1,p2,p3,p4,max range PRIMARY PRIMARY 4 NULL 8 Using where; Using index
  467. SELECT * FROM t1 WHERE a = 1;
  468. a
  469. 1
  470. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 1;
  471. id select_type table partitions type possible_keys key key_len ref rows Extra
  472. 1 SIMPLE t1 p1 system PRIMARY NULL NULL NULL 1
  473. SELECT * FROM t1 WHERE a = 2;
  474. a
  475. 2
  476. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 2;
  477. id select_type table partitions type possible_keys key key_len ref rows Extra
  478. 1 SIMPLE t1 p2 system PRIMARY NULL NULL NULL 1
  479. SELECT * FROM t1 WHERE a = 3;
  480. a
  481. 3
  482. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 3;
  483. id select_type table partitions type possible_keys key key_len ref rows Extra
  484. 1 SIMPLE t1 p3 system PRIMARY NULL NULL NULL 1
  485. SELECT * FROM t1 WHERE a = 4;
  486. a
  487. 4
  488. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 4;
  489. id select_type table partitions type possible_keys key key_len ref rows Extra
  490. 1 SIMPLE t1 p4 system PRIMARY NULL NULL NULL 1
  491. SELECT * FROM t1 WHERE a = 5;
  492. a
  493. 5
  494. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 5;
  495. id select_type table partitions type possible_keys key key_len ref rows Extra
  496. 1 SIMPLE t1 max const PRIMARY PRIMARY 4 const 1 Using index
  497. SELECT * FROM t1 WHERE a = 6;
  498. a
  499. 6
  500. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 6;
  501. id select_type table partitions type possible_keys key key_len ref rows Extra
  502. 1 SIMPLE t1 max const PRIMARY PRIMARY 4 const 1 Using index
  503. SELECT * FROM t1 WHERE a >= 1;
  504. a
  505. 1
  506. 2
  507. 3
  508. 4
  509. 5
  510. 6
  511. 7
  512. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 1;
  513. id select_type table partitions type possible_keys key key_len ref rows Extra
  514. 1 SIMPLE t1 p1,p2,p3,p4,max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  515. SELECT * FROM t1 WHERE a >= 2;
  516. a
  517. 2
  518. 3
  519. 4
  520. 5
  521. 6
  522. 7
  523. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 2;
  524. id select_type table partitions type possible_keys key key_len ref rows Extra
  525. 1 SIMPLE t1 p2,p3,p4,max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  526. SELECT * FROM t1 WHERE a >= 3;
  527. a
  528. 3
  529. 4
  530. 5
  531. 6
  532. 7
  533. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 3;
  534. id select_type table partitions type possible_keys key key_len ref rows Extra
  535. 1 SIMPLE t1 p3,p4,max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  536. SELECT * FROM t1 WHERE a >= 4;
  537. a
  538. 4
  539. 5
  540. 6
  541. 7
  542. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 4;
  543. id select_type table partitions type possible_keys key key_len ref rows Extra
  544. 1 SIMPLE t1 p4,max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  545. SELECT * FROM t1 WHERE a >= 5;
  546. a
  547. 5
  548. 6
  549. 7
  550. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 5;
  551. id select_type table partitions type possible_keys key key_len ref rows Extra
  552. 1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  553. SELECT * FROM t1 WHERE a >= 6;
  554. a
  555. 6
  556. 7
  557. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 6;
  558. id select_type table partitions type possible_keys key key_len ref rows Extra
  559. 1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  560. SELECT * FROM t1 WHERE a > 1;
  561. a
  562. 2
  563. 3
  564. 4
  565. 5
  566. 6
  567. 7
  568. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 1;
  569. id select_type table partitions type possible_keys key key_len ref rows Extra
  570. 1 SIMPLE t1 p2,p3,p4,max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  571. SELECT * FROM t1 WHERE a > 2;
  572. a
  573. 3
  574. 4
  575. 5
  576. 6
  577. 7
  578. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 2;
  579. id select_type table partitions type possible_keys key key_len ref rows Extra
  580. 1 SIMPLE t1 p3,p4,max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  581. SELECT * FROM t1 WHERE a > 3;
  582. a
  583. 4
  584. 5
  585. 6
  586. 7
  587. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 3;
  588. id select_type table partitions type possible_keys key key_len ref rows Extra
  589. 1 SIMPLE t1 p4,max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  590. SELECT * FROM t1 WHERE a > 4;
  591. a
  592. 5
  593. 6
  594. 7
  595. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 4;
  596. id select_type table partitions type possible_keys key key_len ref rows Extra
  597. 1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  598. SELECT * FROM t1 WHERE a > 5;
  599. a
  600. 6
  601. 7
  602. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 5;
  603. id select_type table partitions type possible_keys key key_len ref rows Extra
  604. 1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  605. SELECT * FROM t1 WHERE a > 6;
  606. a
  607. 7
  608. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 6;
  609. id select_type table partitions type possible_keys key key_len ref rows Extra
  610. 1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
  611. DROP TABLE t1;
  612. # test of RANGE and index
  613. CREATE TABLE t1 (a DATE, KEY(a))
  614. PARTITION BY RANGE (TO_DAYS(a))
  615. (PARTITION `pNULL` VALUES LESS THAN (0),
  616. PARTITION `p0001-01-01` VALUES LESS THAN (366 + 1),
  617. PARTITION `p1001-01-01` VALUES LESS THAN (TO_DAYS('1001-01-01') + 1),
  618. PARTITION `p2001-01-01` VALUES LESS THAN (TO_DAYS('2001-01-01') + 1));
  619. INSERT INTO t1 VALUES ('0000-00-00'), ('0000-01-02'), ('0001-01-01'),
  620. ('1001-00-00'), ('1001-01-01'), ('1002-00-00'), ('2001-01-01');
  621. SELECT * FROM t1 WHERE a < '1001-01-01';
  622. a
  623. 0000-00-00
  624. 0000-01-02
  625. 0001-01-01
  626. 1001-00-00
  627. SELECT * FROM t1 WHERE a <= '1001-01-01';
  628. a
  629. 0000-00-00
  630. 0000-01-02
  631. 0001-01-01
  632. 1001-00-00
  633. 1001-01-01
  634. SELECT * FROM t1 WHERE a >= '1001-01-01';
  635. a
  636. 1001-01-01
  637. 1002-00-00
  638. 2001-01-01
  639. SELECT * FROM t1 WHERE a > '1001-01-01';
  640. a
  641. 1002-00-00
  642. 2001-01-01
  643. SELECT * FROM t1 WHERE a = '1001-01-01';
  644. a
  645. 1001-01-01
  646. SELECT * FROM t1 WHERE a < '1001-00-00';
  647. a
  648. 0000-00-00
  649. 0000-01-02
  650. 0001-01-01
  651. SELECT * FROM t1 WHERE a <= '1001-00-00';
  652. a
  653. 0000-00-00
  654. 0000-01-02
  655. 0001-01-01
  656. 1001-00-00
  657. SELECT * FROM t1 WHERE a >= '1001-00-00';
  658. a
  659. 1001-00-00
  660. 1001-01-01
  661. 1002-00-00
  662. 2001-01-01
  663. SELECT * FROM t1 WHERE a > '1001-00-00';
  664. a
  665. 1001-01-01
  666. 1002-00-00
  667. 2001-01-01
  668. SELECT * FROM t1 WHERE a = '1001-00-00';
  669. a
  670. 1001-00-00
  671. # Disabling warnings for the invalid date
  672. SELECT * FROM t1 WHERE a < '1999-02-31';
  673. a
  674. 0000-00-00
  675. 0000-01-02
  676. 0001-01-01
  677. 1001-00-00
  678. 1001-01-01
  679. 1002-00-00
  680. SELECT * FROM t1 WHERE a <= '1999-02-31';
  681. a
  682. 0000-00-00
  683. 0000-01-02
  684. 0001-01-01
  685. 1001-00-00
  686. 1001-01-01
  687. 1002-00-00
  688. SELECT * FROM t1 WHERE a >= '1999-02-31';
  689. a
  690. 2001-01-01
  691. SELECT * FROM t1 WHERE a > '1999-02-31';
  692. a
  693. 2001-01-01
  694. SELECT * FROM t1 WHERE a = '1999-02-31';
  695. a
  696. SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
  697. a
  698. 0000-00-00
  699. 0000-01-02
  700. 0001-01-01
  701. 1001-00-00
  702. 1001-01-01
  703. 1002-00-00
  704. SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
  705. a
  706. 0000-00-00
  707. 0000-01-02
  708. 0001-01-01
  709. 1001-00-00
  710. 1001-01-01
  711. SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
  712. a
  713. 1001-00-00
  714. 1001-01-01
  715. 1002-00-00
  716. SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
  717. a
  718. 0001-01-01
  719. 1001-00-00
  720. 1001-01-01
  721. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-01-01';
  722. id select_type table partitions type possible_keys key key_len ref rows Extra
  723. 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 range a a 4 NULL 3 Using where; Using index
  724. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-01-01';
  725. id select_type table partitions type possible_keys key key_len ref rows Extra
  726. 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 range a a 4 NULL 3 Using where; Using index
  727. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-01-01';
  728. id select_type table partitions type possible_keys key key_len ref rows Extra
  729. 1 SIMPLE t1 pNULL,p1001-01-01,p2001-01-01 range a a 4 NULL 4 Using where; Using index
  730. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-01-01';
  731. id select_type table partitions type possible_keys key key_len ref rows Extra
  732. 1 SIMPLE t1 pNULL,p2001-01-01 range a a 4 NULL 3 Using where; Using index
  733. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-01-01';
  734. id select_type table partitions type possible_keys key key_len ref rows Extra
  735. 1 SIMPLE t1 p1001-01-01 system a NULL NULL NULL 1
  736. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-00-00';
  737. id select_type table partitions type possible_keys key key_len ref rows Extra
  738. 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 range a a 4 NULL 3 Using where; Using index
  739. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-00-00';
  740. id select_type table partitions type possible_keys key key_len ref rows Extra
  741. 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 range a a 4 NULL 3 Using where; Using index
  742. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-00-00';
  743. id select_type table partitions type possible_keys key key_len ref rows Extra
  744. 1 SIMPLE t1 pNULL,p1001-01-01,p2001-01-01 range a a 4 NULL 4 Using where; Using index
  745. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-00-00';
  746. id select_type table partitions type possible_keys key key_len ref rows Extra
  747. 1 SIMPLE t1 pNULL,p1001-01-01,p2001-01-01 range a a 4 NULL 4 Using where; Using index
  748. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-00-00';
  749. id select_type table partitions type possible_keys key key_len ref rows Extra
  750. 1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index
  751. # Disabling warnings for the invalid date
  752. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1999-02-31';
  753. id select_type table partitions type possible_keys key key_len ref rows Extra
  754. 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01,p2001-01-01 range a a 4 NULL 5 Using where; Using index
  755. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1999-02-31';
  756. id select_type table partitions type possible_keys key key_len ref rows Extra
  757. 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01,p2001-01-01 range a a 4 NULL 5 Using where; Using index
  758. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1999-02-31';
  759. id select_type table partitions type possible_keys key key_len ref rows Extra
  760. 1 SIMPLE t1 pNULL,p2001-01-01 index a a 4 NULL 7 Using where; Using index
  761. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1999-02-31';
  762. id select_type table partitions type possible_keys key key_len ref rows Extra
  763. 1 SIMPLE t1 pNULL,p2001-01-01 index a a 4 NULL 7 Using where; Using index
  764. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31';
  765. id select_type table partitions type possible_keys key key_len ref rows Extra
  766. 1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index
  767. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
  768. id select_type table partitions type possible_keys key key_len ref rows Extra
  769. 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01,p2001-01-01 range a a 4 NULL 5 Using where; Using index
  770. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
  771. id select_type table partitions type possible_keys key key_len ref rows Extra
  772. 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 range a a 4 NULL 3 Using where; Using index
  773. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
  774. id select_type table partitions type possible_keys key key_len ref rows Extra
  775. 1 SIMPLE t1 pNULL,p1001-01-01,p2001-01-01 range a a 4 NULL 3 Using where; Using index
  776. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
  777. id select_type table partitions type possible_keys key key_len ref rows Extra
  778. 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 range a a 4 NULL 3 Using where; Using index
  779. # test without index
  780. ALTER TABLE t1 DROP KEY a;
  781. SELECT * FROM t1 WHERE a < '1001-01-01';
  782. a
  783. 0000-00-00
  784. 0000-01-02
  785. 0001-01-01
  786. 1001-00-00
  787. SELECT * FROM t1 WHERE a <= '1001-01-01';
  788. a
  789. 0000-00-00
  790. 0000-01-02
  791. 0001-01-01
  792. 1001-00-00
  793. 1001-01-01
  794. SELECT * FROM t1 WHERE a >= '1001-01-01';
  795. a
  796. 1001-01-01
  797. 1002-00-00
  798. 2001-01-01
  799. SELECT * FROM t1 WHERE a > '1001-01-01';
  800. a
  801. 1002-00-00
  802. 2001-01-01
  803. SELECT * FROM t1 WHERE a = '1001-01-01';
  804. a
  805. 1001-01-01
  806. SELECT * FROM t1 WHERE a < '1001-00-00';
  807. a
  808. 0000-00-00
  809. 0000-01-02
  810. 0001-01-01
  811. SELECT * FROM t1 WHERE a <= '1001-00-00';
  812. a
  813. 0000-00-00
  814. 0000-01-02
  815. 0001-01-01
  816. 1001-00-00
  817. SELECT * FROM t1 WHERE a >= '1001-00-00';
  818. a
  819. 1001-00-00
  820. 1001-01-01
  821. 1002-00-00
  822. 2001-01-01
  823. SELECT * FROM t1 WHERE a > '1001-00-00';
  824. a
  825. 1001-01-01
  826. 1002-00-00
  827. 2001-01-01
  828. SELECT * FROM t1 WHERE a = '1001-00-00';
  829. a
  830. 1001-00-00
  831. # Disabling warnings for the invalid date
  832. SELECT * FROM t1 WHERE a < '1999-02-31';
  833. a
  834. 0000-00-00
  835. 0000-01-02
  836. 0001-01-01
  837. 1001-00-00
  838. 1001-01-01
  839. 1002-00-00
  840. SELECT * FROM t1 WHERE a <= '1999-02-31';
  841. a
  842. 0000-00-00
  843. 0000-01-02
  844. 0001-01-01
  845. 1001-00-00
  846. 1001-01-01
  847. 1002-00-00
  848. SELECT * FROM t1 WHERE a >= '1999-02-31';
  849. a
  850. 2001-01-01
  851. SELECT * FROM t1 WHERE a > '1999-02-31';
  852. a
  853. 2001-01-01
  854. SELECT * FROM t1 WHERE a = '1999-02-31';
  855. a
  856. SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
  857. a
  858. 0000-00-00
  859. 0000-01-02
  860. 0001-01-01
  861. 1001-00-00
  862. 1001-01-01
  863. 1002-00-00
  864. SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
  865. a
  866. 0000-00-00
  867. 0000-01-02
  868. 0001-01-01
  869. 1001-00-00
  870. 1001-01-01
  871. SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
  872. a
  873. 1001-00-00
  874. 1001-01-01
  875. 1002-00-00
  876. SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
  877. a
  878. 0001-01-01
  879. 1001-00-00
  880. 1001-01-01
  881. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-01-01';
  882. id select_type table partitions type possible_keys key key_len ref rows Extra
  883. 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
  884. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-01-01';
  885. id select_type table partitions type possible_keys key key_len ref rows Extra
  886. 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
  887. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-01-01';
  888. id select_type table partitions type possible_keys key key_len ref rows Extra
  889. 1 SIMPLE t1 pNULL,p1001-01-01,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
  890. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-01-01';
  891. id select_type table partitions type possible_keys key key_len ref rows Extra
  892. 1 SIMPLE t1 pNULL,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
  893. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-01-01';
  894. id select_type table partitions type possible_keys key key_len ref rows Extra
  895. 1 SIMPLE t1 p1001-01-01 system NULL NULL NULL NULL 1
  896. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-00-00';
  897. id select_type table partitions type possible_keys key key_len ref rows Extra
  898. 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
  899. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-00-00';
  900. id select_type table partitions type possible_keys key key_len ref rows Extra
  901. 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
  902. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-00-00';
  903. id select_type table partitions type possible_keys key key_len ref rows Extra
  904. 1 SIMPLE t1 pNULL,p1001-01-01,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
  905. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-00-00';
  906. id select_type table partitions type possible_keys key key_len ref rows Extra
  907. 1 SIMPLE t1 pNULL,p1001-01-01,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
  908. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-00-00';
  909. id select_type table partitions type possible_keys key key_len ref rows Extra
  910. 1 SIMPLE t1 pNULL ALL NULL NULL NULL NULL 7 Using where
  911. # Disabling warnings for the invalid date
  912. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1999-02-31';
  913. id select_type table partitions type possible_keys key key_len ref rows Extra
  914. 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
  915. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1999-02-31';
  916. id select_type table partitions type possible_keys key key_len ref rows Extra
  917. 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
  918. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1999-02-31';
  919. id select_type table partitions type possible_keys key key_len ref rows Extra
  920. 1 SIMPLE t1 pNULL,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
  921. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1999-02-31';
  922. id select_type table partitions type possible_keys key key_len ref rows Extra
  923. 1 SIMPLE t1 pNULL,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
  924. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31';
  925. id select_type table partitions type possible_keys key key_len ref rows Extra
  926. 1 SIMPLE t1 pNULL ALL NULL NULL NULL NULL 7 Using where
  927. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
  928. id select_type table partitions type possible_keys key key_len ref rows Extra
  929. 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
  930. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
  931. id select_type table partitions type possible_keys key key_len ref rows Extra
  932. 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
  933. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
  934. id select_type table partitions type possible_keys key key_len ref rows Extra
  935. 1 SIMPLE t1 pNULL,p1001-01-01,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
  936. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
  937. id select_type table partitions type possible_keys key key_len ref rows Extra
  938. 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
  939. DROP TABLE t1;
  940. # test of LIST and index
  941. CREATE TABLE t1 (a DATE, KEY(a))
  942. PARTITION BY LIST (TO_DAYS(a))
  943. (PARTITION `p0001-01-01` VALUES IN (TO_DAYS('0001-01-01')),
  944. PARTITION `p2001-01-01` VALUES IN (TO_DAYS('2001-01-01')),
  945. PARTITION `pNULL` VALUES IN (NULL),
  946. PARTITION `p0000-01-02` VALUES IN (TO_DAYS('0000-01-02')),
  947. PARTITION `p1001-01-01` VALUES IN (TO_DAYS('1001-01-01')));
  948. INSERT INTO t1 VALUES ('0000-00-00'), ('0000-01-02'), ('0001-01-01'),
  949. ('1001-00-00'), ('1001-01-01'), ('1002-00-00'), ('2001-01-01');
  950. SELECT * FROM t1 WHERE a < '1001-01-01';
  951. a
  952. 0000-00-00
  953. 0000-01-02
  954. 0001-01-01
  955. 1001-00-00
  956. SELECT * FROM t1 WHERE a <= '1001-01-01';
  957. a
  958. 0000-00-00
  959. 0000-01-02
  960. 0001-01-01
  961. 1001-00-00
  962. 1001-01-01
  963. SELECT * FROM t1 WHERE a >= '1001-01-01';
  964. a
  965. 1001-01-01
  966. 1002-00-00
  967. 2001-01-01
  968. SELECT * FROM t1 WHERE a > '1001-01-01';
  969. a
  970. 1002-00-00
  971. 2001-01-01
  972. SELECT * FROM t1 WHERE a = '1001-01-01';
  973. a
  974. 1001-01-01
  975. SELECT * FROM t1 WHERE a < '1001-00-00';
  976. a
  977. 0000-00-00
  978. 0000-01-02
  979. 0001-01-01
  980. SELECT * FROM t1 WHERE a <= '1001-00-00';
  981. a
  982. 0000-00-00
  983. 0000-01-02
  984. 0001-01-01
  985. 1001-00-00
  986. SELECT * FROM t1 WHERE a >= '1001-00-00';
  987. a
  988. 1001-00-00
  989. 1001-01-01
  990. 1002-00-00
  991. 2001-01-01
  992. SELECT * FROM t1 WHERE a > '1001-00-00';
  993. a
  994. 1001-01-01
  995. 1002-00-00
  996. 2001-01-01
  997. SELECT * FROM t1 WHERE a = '1001-00-00';
  998. a
  999. 1001-00-00
  1000. # Disabling warnings for the invalid date
  1001. SELECT * FROM t1 WHERE a < '1999-02-31';
  1002. a
  1003. 0000-00-00
  1004. 0000-01-02
  1005. 0001-01-01
  1006. 1001-00-00
  1007. 1001-01-01
  1008. 1002-00-00
  1009. SELECT * FROM t1 WHERE a <= '1999-02-31';
  1010. a
  1011. 0000-00-00
  1012. 0000-01-02
  1013. 0001-01-01
  1014. 1001-00-00
  1015. 1001-01-01
  1016. 1002-00-00
  1017. SELECT * FROM t1 WHERE a >= '1999-02-31';
  1018. a
  1019. 2001-01-01
  1020. SELECT * FROM t1 WHERE a > '1999-02-31';
  1021. a
  1022. 2001-01-01
  1023. SELECT * FROM t1 WHERE a = '1999-02-31';
  1024. a
  1025. SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
  1026. a
  1027. 0000-00-00
  1028. 0000-01-02
  1029. 0001-01-01
  1030. 1001-00-00
  1031. 1001-01-01
  1032. 1002-00-00
  1033. SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
  1034. a
  1035. 0000-00-00
  1036. 0000-01-02
  1037. 0001-01-01
  1038. 1001-00-00
  1039. 1001-01-01
  1040. SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
  1041. a
  1042. 1001-00-00
  1043. 1001-01-01
  1044. 1002-00-00
  1045. SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
  1046. a
  1047. 0001-01-01
  1048. 1001-00-00
  1049. 1001-01-01
  1050. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-01-01';
  1051. id select_type table partitions type possible_keys key key_len ref rows Extra
  1052. 1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 range a a 4 NULL 3 Using where; Using index
  1053. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-01-01';
  1054. id select_type table partitions type possible_keys key key_len ref rows Extra
  1055. 1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 4 Using where; Using index
  1056. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-01-01';
  1057. id select_type table partitions type possible_keys key key_len ref rows Extra
  1058. 1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 range a a 4 NULL 4 Using where; Using index
  1059. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-01-01';
  1060. id select_type table partitions type possible_keys key key_len ref rows Extra
  1061. 1 SIMPLE t1 p2001-01-01,pNULL range a a 4 NULL 3 Using where; Using index
  1062. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-01-01';
  1063. id select_type table partitions type possible_keys key key_len ref rows Extra
  1064. 1 SIMPLE t1 p1001-01-01 system a NULL NULL NULL 1
  1065. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-00-00';
  1066. id select_type table partitions type possible_keys key key_len ref rows Extra
  1067. 1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 range a a 4 NULL 3 Using where; Using index
  1068. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-00-00';
  1069. id select_type table partitions type possible_keys key key_len ref rows Extra
  1070. 1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 range a a 4 NULL 3 Using where; Using index
  1071. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-00-00';
  1072. id select_type table partitions type possible_keys key key_len ref rows Extra
  1073. 1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 range a a 4 NULL 4 Using where; Using index
  1074. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-00-00';
  1075. id select_type table partitions type possible_keys key key_len ref rows Extra
  1076. 1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 range a a 4 NULL 4 Using where; Using index
  1077. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-00-00';
  1078. id select_type table partitions type possible_keys key key_len ref rows Extra
  1079. 1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index
  1080. # Disabling warnings for the invalid date
  1081. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1999-02-31';
  1082. id select_type table partitions type possible_keys key key_len ref rows Extra
  1083. 1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 5 Using where; Using index
  1084. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1999-02-31';
  1085. id select_type table partitions type possible_keys key key_len ref rows Extra
  1086. 1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 5 Using where; Using index
  1087. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1999-02-31';
  1088. id select_type table partitions type possible_keys key key_len ref rows Extra
  1089. 1 SIMPLE t1 p2001-01-01,pNULL index a a 4 NULL 7 Using where; Using index
  1090. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1999-02-31';
  1091. id select_type table partitions type possible_keys key key_len ref rows Extra
  1092. 1 SIMPLE t1 p2001-01-01,pNULL index a a 4 NULL 7 Using where; Using index
  1093. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31';
  1094. id select_type table partitions type possible_keys key key_len ref rows Extra
  1095. 1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index
  1096. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
  1097. id select_type table partitions type possible_keys key key_len ref rows Extra
  1098. 1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 5 Using where; Using index
  1099. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
  1100. id select_type table partitions type possible_keys key key_len ref rows Extra
  1101. 1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 4 Using where; Using index
  1102. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
  1103. id select_type table partitions type possible_keys key key_len ref rows Extra
  1104. 1 SIMPLE t1 pNULL,p1001-01-01 index a a 4 NULL 7 Using where; Using index
  1105. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
  1106. id select_type table partitions type possible_keys key key_len ref rows Extra
  1107. 1 SIMPLE t1 p0001-01-01,pNULL,p1001-01-01 range a a 4 NULL 3 Using where; Using index
  1108. # test without index
  1109. ALTER TABLE t1 DROP KEY a;
  1110. SELECT * FROM t1 WHERE a < '1001-01-01';
  1111. a
  1112. 0000-00-00
  1113. 0000-01-02
  1114. 0001-01-01
  1115. 1001-00-00
  1116. SELECT * FROM t1 WHERE a <= '1001-01-01';
  1117. a
  1118. 0000-00-00
  1119. 0000-01-02
  1120. 0001-01-01
  1121. 1001-00-00
  1122. 1001-01-01
  1123. SELECT * FROM t1 WHERE a >= '1001-01-01';
  1124. a
  1125. 1001-01-01
  1126. 1002-00-00
  1127. 2001-01-01
  1128. SELECT * FROM t1 WHERE a > '1001-01-01';
  1129. a
  1130. 1002-00-00
  1131. 2001-01-01
  1132. SELECT * FROM t1 WHERE a = '1001-01-01';
  1133. a
  1134. 1001-01-01
  1135. SELECT * FROM t1 WHERE a < '1001-00-00';
  1136. a
  1137. 0000-00-00
  1138. 0000-01-02
  1139. 0001-01-01
  1140. SELECT * FROM t1 WHERE a <= '1001-00-00';
  1141. a
  1142. 0000-00-00
  1143. 0000-01-02
  1144. 0001-01-01
  1145. 1001-00-00
  1146. SELECT * FROM t1 WHERE a >= '1001-00-00';
  1147. a
  1148. 1001-00-00
  1149. 1001-01-01
  1150. 1002-00-00
  1151. 2001-01-01
  1152. SELECT * FROM t1 WHERE a > '1001-00-00';
  1153. a
  1154. 1001-01-01
  1155. 1002-00-00
  1156. 2001-01-01
  1157. SELECT * FROM t1 WHERE a = '1001-00-00';
  1158. a
  1159. 1001-00-00
  1160. # Disabling warnings for the invalid date
  1161. SELECT * FROM t1 WHERE a < '1999-02-31';
  1162. a
  1163. 0000-00-00
  1164. 0000-01-02
  1165. 0001-01-01
  1166. 1001-00-00
  1167. 1001-01-01
  1168. 1002-00-00
  1169. SELECT * FROM t1 WHERE a <= '1999-02-31';
  1170. a
  1171. 0000-00-00
  1172. 0000-01-02
  1173. 0001-01-01
  1174. 1001-00-00
  1175. 1001-01-01
  1176. 1002-00-00
  1177. SELECT * FROM t1 WHERE a >= '1999-02-31';
  1178. a
  1179. 2001-01-01
  1180. SELECT * FROM t1 WHERE a > '1999-02-31';
  1181. a
  1182. 2001-01-01
  1183. SELECT * FROM t1 WHERE a = '1999-02-31';
  1184. a
  1185. SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
  1186. a
  1187. 0000-00-00
  1188. 0000-01-02
  1189. 0001-01-01
  1190. 1001-00-00
  1191. 1001-01-01
  1192. 1002-00-00
  1193. SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
  1194. a
  1195. 0000-00-00
  1196. 0000-01-02
  1197. 0001-01-01
  1198. 1001-00-00
  1199. 1001-01-01
  1200. SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
  1201. a
  1202. 1001-00-00
  1203. 1001-01-01
  1204. 1002-00-00
  1205. SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
  1206. a
  1207. 0001-01-01
  1208. 1001-00-00
  1209. 1001-01-01
  1210. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-01-01';
  1211. id select_type table partitions type possible_keys key key_len ref rows Extra
  1212. 1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 ALL NULL NULL NULL NULL 7 Using where
  1213. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-01-01';
  1214. id select_type table partitions type possible_keys key key_len ref rows Extra
  1215. 1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
  1216. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-01-01';
  1217. id select_type table partitions type possible_keys key key_len ref rows Extra
  1218. 1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
  1219. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-01-01';
  1220. id select_type table partitions type possible_keys key key_len ref rows Extra
  1221. 1 SIMPLE t1 p2001-01-01,pNULL ALL NULL NULL NULL NULL 7 Using where
  1222. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-01-01';
  1223. id select_type table partitions type possible_keys key key_len ref rows Extra
  1224. 1 SIMPLE t1 p1001-01-01 system NULL NULL NULL NULL 1
  1225. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-00-00';
  1226. id select_type table partitions type possible_keys key key_len ref rows Extra
  1227. 1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 ALL NULL NULL NULL NULL 7 Using where
  1228. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-00-00';
  1229. id select_type table partitions type possible_keys key key_len ref rows Extra
  1230. 1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 ALL NULL NULL NULL NULL 7 Using where
  1231. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-00-00';
  1232. id select_type table partitions type possible_keys key key_len ref rows Extra
  1233. 1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
  1234. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-00-00';
  1235. id select_type table partitions type possible_keys key key_len ref rows Extra
  1236. 1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
  1237. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-00-00';
  1238. id select_type table partitions type possible_keys key key_len ref rows Extra
  1239. 1 SIMPLE t1 pNULL ALL NULL NULL NULL NULL 7 Using where
  1240. # Disabling warnings for the invalid date
  1241. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1999-02-31';
  1242. id select_type table partitions type possible_keys key key_len ref rows Extra
  1243. 1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
  1244. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1999-02-31';
  1245. id select_type table partitions type possible_keys key key_len ref rows Extra
  1246. 1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
  1247. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1999-02-31';
  1248. id select_type table partitions type possible_keys key key_len ref rows Extra
  1249. 1 SIMPLE t1 p2001-01-01,pNULL ALL NULL NULL NULL NULL 7 Using where
  1250. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1999-02-31';
  1251. id select_type table partitions type possible_keys key key_len ref rows Extra
  1252. 1 SIMPLE t1 p2001-01-01,pNULL ALL NULL NULL NULL NULL 7 Using where
  1253. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31';
  1254. id select_type table partitions type possible_keys key key_len ref rows Extra
  1255. 1 SIMPLE t1 pNULL ALL NULL NULL NULL NULL 7 Using where
  1256. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
  1257. id select_type table partitions type possible_keys key key_len ref rows Extra
  1258. 1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
  1259. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
  1260. id select_type table partitions type possible_keys key key_len ref rows Extra
  1261. 1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
  1262. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
  1263. id select_type table partitions type possible_keys key key_len ref rows Extra
  1264. 1 SIMPLE t1 pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
  1265. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
  1266. id select_type table partitions type possible_keys key key_len ref rows Extra
  1267. 1 SIMPLE t1 p0001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
  1268. DROP TABLE t1;
  1269. # Test with DATETIME column NOT NULL
  1270. CREATE TABLE t1 (
  1271. a int(10) unsigned NOT NULL,
  1272. b DATETIME NOT NULL,
  1273. PRIMARY KEY (a, b)
  1274. ) PARTITION BY RANGE (TO_DAYS(b))
  1275. (PARTITION p20090401 VALUES LESS THAN (TO_DAYS('2009-04-02')),
  1276. PARTITION p20090402 VALUES LESS THAN (TO_DAYS('2009-04-03')),
  1277. PARTITION p20090403 VALUES LESS THAN (TO_DAYS('2009-04-04')),
  1278. PARTITION p20090404 VALUES LESS THAN (TO_DAYS('2009-04-05')),
  1279. PARTITION p20090405 VALUES LESS THAN MAXVALUE);
  1280. INSERT INTO t1 VALUES (1, '2009-01-01'), (1, '2009-04-01'), (2, '2009-04-01'),
  1281. (1, '2009-04-02'), (2, '2009-04-02'), (1, '2009-04-02 23:59:59'),
  1282. (1, '2009-04-03'), (2, '2009-04-03'), (1, '2009-04-04'), (2, '2009-04-04'),
  1283. (1, '2009-04-05'), (1, '2009-04-06'), (1, '2009-04-07');
  1284. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATETIME);
  1285. id select_type table partitions type possible_keys key key_len ref rows Extra
  1286. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
  1287. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATETIME);
  1288. id select_type table partitions type possible_keys key key_len ref rows Extra
  1289. 1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 8 Using where; Using index
  1290. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATETIME);
  1291. id select_type table partitions type possible_keys key key_len ref rows Extra
  1292. 1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 8 Using where; Using index
  1293. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATETIME);
  1294. id select_type table partitions type possible_keys key key_len ref rows Extra
  1295. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1296. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATETIME);
  1297. id select_type table partitions type possible_keys key key_len ref rows Extra
  1298. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1299. EXPLAIN PARTITIONS SELECT * FROM t1
  1300. WHERE b < CAST('2009-04-02 23:59:59' AS DATETIME);
  1301. id select_type table partitions type possible_keys key key_len ref rows Extra
  1302. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1303. EXPLAIN PARTITIONS SELECT * FROM t1
  1304. WHERE b <= CAST('2009-04-02 23:59:59' AS DATETIME);
  1305. id select_type table partitions type possible_keys key key_len ref rows Extra
  1306. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1307. EXPLAIN PARTITIONS SELECT * FROM t1
  1308. WHERE b = CAST('2009-04-02 23:59:59' AS DATETIME);
  1309. id select_type table partitions type possible_keys key key_len ref rows Extra
  1310. 1 SIMPLE t1 p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1311. EXPLAIN PARTITIONS SELECT * FROM t1
  1312. WHERE b >= CAST('2009-04-02 23:59:59' AS DATETIME);
  1313. id select_type table partitions type possible_keys key key_len ref rows Extra
  1314. 1 SIMPLE t1 p20090401,p20090402,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1315. EXPLAIN PARTITIONS SELECT * FROM t1
  1316. WHERE b > CAST('2009-04-02 23:59:59' AS DATETIME);
  1317. id select_type table partitions type possible_keys key key_len ref rows Extra
  1318. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1319. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATE);
  1320. id select_type table partitions type possible_keys key key_len ref rows Extra
  1321. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1322. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATE);
  1323. id select_type table partitions type possible_keys key key_len ref rows Extra
  1324. 1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1325. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATE);
  1326. id select_type table partitions type possible_keys key key_len ref rows Extra
  1327. 1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1328. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATE);
  1329. id select_type table partitions type possible_keys key key_len ref rows Extra
  1330. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1331. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATE);
  1332. id select_type table partitions type possible_keys key key_len ref rows Extra
  1333. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1334. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-03 00:00:00';
  1335. id select_type table partitions type possible_keys key key_len ref rows Extra
  1336. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1337. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-03 00:00:00';
  1338. id select_type table partitions type possible_keys key key_len ref rows Extra
  1339. 1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1340. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-03 00:00:00';
  1341. id select_type table partitions type possible_keys key key_len ref rows Extra
  1342. 1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1343. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-03 00:00:00';
  1344. id select_type table partitions type possible_keys key key_len ref rows Extra
  1345. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1346. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-03 00:00:00';
  1347. id select_type table partitions type possible_keys key key_len ref rows Extra
  1348. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1349. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-02 23:59:59';
  1350. id select_type table partitions type possible_keys key key_len ref rows Extra
  1351. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1352. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-02 23:59:59';
  1353. id select_type table partitions type possible_keys key key_len ref rows Extra
  1354. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1355. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-02 23:59:59';
  1356. id select_type table partitions type possible_keys key key_len ref rows Extra
  1357. 1 SIMPLE t1 p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1358. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-02 23:59:59';
  1359. id select_type table partitions type possible_keys key key_len ref rows Extra
  1360. 1 SIMPLE t1 p20090401,p20090402,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1361. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-02 23:59:59';
  1362. id select_type table partitions type possible_keys key key_len ref rows Extra
  1363. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1364. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-03';
  1365. id select_type table partitions type possible_keys key key_len ref rows Extra
  1366. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1367. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-03';
  1368. id select_type table partitions type possible_keys key key_len ref rows Extra
  1369. 1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1370. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-03';
  1371. id select_type table partitions type possible_keys key key_len ref rows Extra
  1372. 1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1373. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-03';
  1374. id select_type table partitions type possible_keys key key_len ref rows Extra
  1375. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1376. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-03';
  1377. id select_type table partitions type possible_keys key key_len ref rows Extra
  1378. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1379. EXPLAIN PARTITIONS SELECT * FROM t1
  1380. WHERE b < CAST('2009-04-03 00:00:01' AS DATETIME);
  1381. id select_type table partitions type possible_keys key key_len ref rows Extra
  1382. 1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1383. EXPLAIN PARTITIONS SELECT * FROM t1
  1384. WHERE b <= CAST('2009-04-03 00:00:01' AS DATETIME);
  1385. id select_type table partitions type possible_keys key key_len ref rows Extra
  1386. 1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1387. EXPLAIN PARTITIONS SELECT * FROM t1
  1388. WHERE b = CAST('2009-04-03 00:00:01' AS DATETIME);
  1389. id select_type table partitions type possible_keys key key_len ref rows Extra
  1390. 1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1391. EXPLAIN PARTITIONS SELECT * FROM t1
  1392. WHERE b >= CAST('2009-04-03 00:00:01' AS DATETIME);
  1393. id select_type table partitions type possible_keys key key_len ref rows Extra
  1394. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1395. EXPLAIN PARTITIONS SELECT * FROM t1
  1396. WHERE b > CAST('2009-04-03 00:00:01' AS DATETIME);
  1397. id select_type table partitions type possible_keys key key_len ref rows Extra
  1398. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1399. EXPLAIN PARTITIONS SELECT * FROM t1
  1400. WHERE b < CAST('2009-04-02 23:59:58' AS DATETIME);
  1401. id select_type table partitions type possible_keys key key_len ref rows Extra
  1402. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1403. EXPLAIN PARTITIONS SELECT * FROM t1
  1404. WHERE b <= CAST('2009-04-02 23:59:58' AS DATETIME);
  1405. id select_type table partitions type possible_keys key key_len ref rows Extra
  1406. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1407. EXPLAIN PARTITIONS SELECT * FROM t1
  1408. WHERE b = CAST('2009-04-02 23:59:58' AS DATETIME);
  1409. id select_type table partitions type possible_keys key key_len ref rows Extra
  1410. 1 SIMPLE t1 p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1411. EXPLAIN PARTITIONS SELECT * FROM t1
  1412. WHERE b >= CAST('2009-04-02 23:59:58' AS DATETIME);
  1413. id select_type table partitions type possible_keys key key_len ref rows Extra
  1414. 1 SIMPLE t1 p20090401,p20090402,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1415. EXPLAIN PARTITIONS SELECT * FROM t1
  1416. WHERE b > CAST('2009-04-02 23:59:58' AS DATETIME);
  1417. id select_type table partitions type possible_keys key key_len ref rows Extra
  1418. 1 SIMPLE t1 p20090401,p20090402,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
  1419. DROP TABLE t1;
  1420. # Test with DATE column NOT NULL
  1421. CREATE TABLE t1 (
  1422. a int(10) unsigned NOT NULL,
  1423. b DATE NOT NULL,
  1424. PRIMARY KEY (a, b)
  1425. ) PARTITION BY RANGE (TO_DAYS(b))
  1426. (PARTITION p20090401 VALUES LESS THAN (TO_DAYS('2009-04-02')),
  1427. PARTITION p20090402 VALUES LESS THAN (TO_DAYS('2009-04-03')),
  1428. PARTITION p20090403 VALUES LESS THAN (TO_DAYS('2009-04-04')),
  1429. PARTITION p20090404 VALUES LESS THAN (TO_DAYS('2009-04-05')),
  1430. PARTITION p20090405 VALUES LESS THAN MAXVALUE);
  1431. INSERT INTO t1 VALUES (1, '2009-01-01'), (1, '2009-04-01'), (2, '2009-04-01'),
  1432. (1, '2009-04-02'), (2, '2009-04-02'), (1, '2009-04-03'), (2, '2009-04-03'),
  1433. (1, '2009-04-04'), (2, '2009-04-04'), (1, '2009-04-05'), (1, '2009-04-06'),
  1434. (1, '2009-04-07');
  1435. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATETIME);
  1436. id select_type table partitions type possible_keys key key_len ref rows Extra
  1437. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 5 Using where; Using index
  1438. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATETIME);
  1439. id select_type table partitions type possible_keys key key_len ref rows Extra
  1440. 1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 7 NULL 7 Using where; Using index
  1441. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATETIME);
  1442. id select_type table partitions type possible_keys key key_len ref rows Extra
  1443. 1 SIMPLE t1 p20090403 index NULL PRIMARY 7 NULL 7 Using where; Using index
  1444. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATETIME);
  1445. id select_type table partitions type possible_keys key key_len ref rows Extra
  1446. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1447. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATETIME);
  1448. id select_type table partitions type possible_keys key key_len ref rows Extra
  1449. 1 SIMPLE t1 p20090401,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1450. EXPLAIN PARTITIONS SELECT * FROM t1
  1451. WHERE b < CAST('2009-04-02 23:59:59' AS DATETIME);
  1452. id select_type table partitions type possible_keys key key_len ref rows Extra
  1453. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1454. EXPLAIN PARTITIONS SELECT * FROM t1
  1455. WHERE b <= CAST('2009-04-02 23:59:59' AS DATETIME);
  1456. id select_type table partitions type possible_keys key key_len ref rows Extra
  1457. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1458. EXPLAIN PARTITIONS SELECT * FROM t1
  1459. WHERE b = CAST('2009-04-02 23:59:59' AS DATETIME);
  1460. id select_type table partitions type possible_keys key key_len ref rows Extra
  1461. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  1462. EXPLAIN PARTITIONS SELECT * FROM t1
  1463. WHERE b >= CAST('2009-04-02 23:59:59' AS DATETIME);
  1464. id select_type table partitions type possible_keys key key_len ref rows Extra
  1465. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1466. EXPLAIN PARTITIONS SELECT * FROM t1
  1467. WHERE b > CAST('2009-04-02 23:59:59' AS DATETIME);
  1468. id select_type table partitions type possible_keys key key_len ref rows Extra
  1469. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1470. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATE);
  1471. id select_type table partitions type possible_keys key key_len ref rows Extra
  1472. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1473. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATE);
  1474. id select_type table partitions type possible_keys key key_len ref rows Extra
  1475. 1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1476. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATE);
  1477. id select_type table partitions type possible_keys key key_len ref rows Extra
  1478. 1 SIMPLE t1 p20090403 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1479. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATE);
  1480. id select_type table partitions type possible_keys key key_len ref rows Extra
  1481. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1482. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATE);
  1483. id select_type table partitions type possible_keys key key_len ref rows Extra
  1484. 1 SIMPLE t1 p20090401,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1485. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-03 00:00:00';
  1486. id select_type table partitions type possible_keys key key_len ref rows Extra
  1487. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1488. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-03 00:00:00';
  1489. id select_type table partitions type possible_keys key key_len ref rows Extra
  1490. 1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1491. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-03 00:00:00';
  1492. id select_type table partitions type possible_keys key key_len ref rows Extra
  1493. 1 SIMPLE t1 p20090403 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1494. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-03 00:00:00';
  1495. id select_type table partitions type possible_keys key key_len ref rows Extra
  1496. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1497. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-03 00:00:00';
  1498. id select_type table partitions type possible_keys key key_len ref rows Extra
  1499. 1 SIMPLE t1 p20090401,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1500. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-02 23:59:59';
  1501. id select_type table partitions type possible_keys key key_len ref rows Extra
  1502. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1503. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-02 23:59:59';
  1504. id select_type table partitions type possible_keys key key_len ref rows Extra
  1505. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1506. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-02 23:59:59';
  1507. id select_type table partitions type possible_keys key key_len ref rows Extra
  1508. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  1509. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-02 23:59:59';
  1510. id select_type table partitions type possible_keys key key_len ref rows Extra
  1511. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1512. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-02 23:59:59';
  1513. id select_type table partitions type possible_keys key key_len ref rows Extra
  1514. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1515. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-03';
  1516. id select_type table partitions type possible_keys key key_len ref rows Extra
  1517. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1518. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-03';
  1519. id select_type table partitions type possible_keys key key_len ref rows Extra
  1520. 1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1521. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-03';
  1522. id select_type table partitions type possible_keys key key_len ref rows Extra
  1523. 1 SIMPLE t1 p20090403 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1524. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-03';
  1525. id select_type table partitions type possible_keys key key_len ref rows Extra
  1526. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1527. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-03';
  1528. id select_type table partitions type possible_keys key key_len ref rows Extra
  1529. 1 SIMPLE t1 p20090401,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1530. EXPLAIN PARTITIONS SELECT * FROM t1
  1531. WHERE b < CAST('2009-04-03 00:00:01' AS DATETIME);
  1532. id select_type table partitions type possible_keys key key_len ref rows Extra
  1533. 1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1534. EXPLAIN PARTITIONS SELECT * FROM t1
  1535. WHERE b <= CAST('2009-04-03 00:00:01' AS DATETIME);
  1536. id select_type table partitions type possible_keys key key_len ref rows Extra
  1537. 1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1538. EXPLAIN PARTITIONS SELECT * FROM t1
  1539. WHERE b = CAST('2009-04-03 00:00:01' AS DATETIME);
  1540. id select_type table partitions type possible_keys key key_len ref rows Extra
  1541. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  1542. EXPLAIN PARTITIONS SELECT * FROM t1
  1543. WHERE b >= CAST('2009-04-03 00:00:01' AS DATETIME);
  1544. id select_type table partitions type possible_keys key key_len ref rows Extra
  1545. 1 SIMPLE t1 p20090401,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1546. EXPLAIN PARTITIONS SELECT * FROM t1
  1547. WHERE b > CAST('2009-04-03 00:00:01' AS DATETIME);
  1548. id select_type table partitions type possible_keys key key_len ref rows Extra
  1549. 1 SIMPLE t1 p20090401,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1550. EXPLAIN PARTITIONS SELECT * FROM t1
  1551. WHERE b < CAST('2009-04-02 23:59:58' AS DATETIME);
  1552. id select_type table partitions type possible_keys key key_len ref rows Extra
  1553. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1554. EXPLAIN PARTITIONS SELECT * FROM t1
  1555. WHERE b <= CAST('2009-04-02 23:59:58' AS DATETIME);
  1556. id select_type table partitions type possible_keys key key_len ref rows Extra
  1557. 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1558. EXPLAIN PARTITIONS SELECT * FROM t1
  1559. WHERE b = CAST('2009-04-02 23:59:58' AS DATETIME);
  1560. id select_type table partitions type possible_keys key key_len ref rows Extra
  1561. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  1562. EXPLAIN PARTITIONS SELECT * FROM t1
  1563. WHERE b >= CAST('2009-04-02 23:59:58' AS DATETIME);
  1564. id select_type table partitions type possible_keys key key_len ref rows Extra
  1565. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1566. EXPLAIN PARTITIONS SELECT * FROM t1
  1567. WHERE b > CAST('2009-04-02 23:59:58' AS DATETIME);
  1568. id select_type table partitions type possible_keys key key_len ref rows Extra
  1569. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
  1570. DROP TABLE t1;
  1571. # Test with DATETIME column NULL
  1572. CREATE TABLE t1 (
  1573. a int(10) unsigned NOT NULL,
  1574. b DATETIME NULL
  1575. ) PARTITION BY RANGE (TO_DAYS(b))
  1576. (PARTITION p20090401 VALUES LESS THAN (TO_DAYS('2009-04-02')),
  1577. PARTITION p20090402 VALUES LESS THAN (TO_DAYS('2009-04-03')),
  1578. PARTITION p20090403 VALUES LESS THAN (TO_DAYS('2009-04-04')),
  1579. PARTITION p20090404 VALUES LESS THAN (TO_DAYS('2009-04-05')),
  1580. PARTITION p20090405 VALUES LESS THAN MAXVALUE);
  1581. INSERT INTO t1 VALUES (1, '2009-01-01'), (1, '2009-04-01'), (2, '2009-04-01'),
  1582. (1, '2009-04-02'), (2, '2009-04-02'), (1, '2009-04-02 23:59:59'),
  1583. (1, '2009-04-03'), (2, '2009-04-03'), (1, '2009-04-04'), (2, '2009-04-04'),
  1584. (1, '2009-04-05'), (1, '2009-04-06'), (1, '2009-04-07');
  1585. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATETIME);
  1586. id select_type table partitions type possible_keys key key_len ref rows Extra
  1587. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 6 Using where
  1588. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATETIME);
  1589. id select_type table partitions type possible_keys key key_len ref rows Extra
  1590. 1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 8 Using where
  1591. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATETIME);
  1592. id select_type table partitions type possible_keys key key_len ref rows Extra
  1593. 1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 8 Using where
  1594. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATETIME);
  1595. id select_type table partitions type possible_keys key key_len ref rows Extra
  1596. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
  1597. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATETIME);
  1598. id select_type table partitions type possible_keys key key_len ref rows Extra
  1599. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
  1600. EXPLAIN PARTITIONS SELECT * FROM t1
  1601. WHERE b < CAST('2009-04-02 23:59:59' AS DATETIME);
  1602. id select_type table partitions type possible_keys key key_len ref rows Extra
  1603. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 13 Using where
  1604. EXPLAIN PARTITIONS SELECT * FROM t1
  1605. WHERE b <= CAST('2009-04-02 23:59:59' AS DATETIME);
  1606. id select_type table partitions type possible_keys key key_len ref rows Extra
  1607. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 13 Using where
  1608. EXPLAIN PARTITIONS SELECT * FROM t1
  1609. WHERE b = CAST('2009-04-02 23:59:59' AS DATETIME);
  1610. id select_type table partitions type possible_keys key key_len ref rows Extra
  1611. 1 SIMPLE t1 p20090402 ALL NULL NULL NULL NULL 13 Using where
  1612. EXPLAIN PARTITIONS SELECT * FROM t1
  1613. WHERE b >= CAST('2009-04-02 23:59:59' AS DATETIME);
  1614. id select_type table partitions type possible_keys key key_len ref rows Extra
  1615. 1 SIMPLE t1 p20090401,p20090402,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
  1616. EXPLAIN PARTITIONS SELECT * FROM t1
  1617. WHERE b > CAST('2009-04-02 23:59:59' AS DATETIME);
  1618. id select_type table partitions type possible_keys key key_len ref rows Extra
  1619. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
  1620. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATE);
  1621. id select_type table partitions type possible_keys key key_len ref rows Extra
  1622. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 13 Using where
  1623. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATE);
  1624. id select_type table partitions type possible_keys key key_len ref rows Extra
  1625. 1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 13 Using where
  1626. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATE);
  1627. id select_type table partitions type possible_keys key key_len ref rows Extra
  1628. 1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 13 Using where
  1629. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATE);
  1630. id select_type table partitions type possible_keys key key_len ref rows Extra
  1631. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
  1632. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATE);
  1633. id select_type table partitions type possible_keys key key_len ref rows Extra
  1634. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
  1635. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-03 00:00:00';
  1636. id select_type table partitions type possible_keys key key_len ref rows Extra
  1637. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 13 Using where
  1638. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-03 00:00:00';
  1639. id select_type table partitions type possible_keys key key_len ref rows Extra
  1640. 1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 13 Using where
  1641. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-03 00:00:00';
  1642. id select_type table partitions type possible_keys key key_len ref rows Extra
  1643. 1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 13 Using where
  1644. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-03 00:00:00';
  1645. id select_type table partitions type possible_keys key key_len ref rows Extra
  1646. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
  1647. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-03 00:00:00';
  1648. id select_type table partitions type possible_keys key key_len ref rows Extra
  1649. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
  1650. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-02 23:59:59';
  1651. id select_type table partitions type possible_keys key key_len ref rows Extra
  1652. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 13 Using where
  1653. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-02 23:59:59';
  1654. id select_type table partitions type possible_keys key key_len ref rows Extra
  1655. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 13 Using where
  1656. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-02 23:59:59';
  1657. id select_type table partitions type possible_keys key key_len ref rows Extra
  1658. 1 SIMPLE t1 p20090402 ALL NULL NULL NULL NULL 13 Using where
  1659. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-02 23:59:59';
  1660. id select_type table partitions type possible_keys key key_len ref rows Extra
  1661. 1 SIMPLE t1 p20090401,p20090402,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
  1662. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-02 23:59:59';
  1663. id select_type table partitions type possible_keys key key_len ref rows Extra
  1664. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
  1665. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-03';
  1666. id select_type table partitions type possible_keys key key_len ref rows Extra
  1667. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 13 Using where
  1668. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-03';
  1669. id select_type table partitions type possible_keys key key_len ref rows Extra
  1670. 1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 13 Using where
  1671. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-03';
  1672. id select_type table partitions type possible_keys key key_len ref rows Extra
  1673. 1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 13 Using where
  1674. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-03';
  1675. id select_type table partitions type possible_keys key key_len ref rows Extra
  1676. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
  1677. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-03';
  1678. id select_type table partitions type possible_keys key key_len ref rows Extra
  1679. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
  1680. EXPLAIN PARTITIONS SELECT * FROM t1
  1681. WHERE b < CAST('2009-04-03 00:00:01' AS DATETIME);
  1682. id select_type table partitions type possible_keys key key_len ref rows Extra
  1683. 1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 13 Using where
  1684. EXPLAIN PARTITIONS SELECT * FROM t1
  1685. WHERE b <= CAST('2009-04-03 00:00:01' AS DATETIME);
  1686. id select_type table partitions type possible_keys key key_len ref rows Extra
  1687. 1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 13 Using where
  1688. EXPLAIN PARTITIONS SELECT * FROM t1
  1689. WHERE b = CAST('2009-04-03 00:00:01' AS DATETIME);
  1690. id select_type table partitions type possible_keys key key_len ref rows Extra
  1691. 1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 13 Using where
  1692. EXPLAIN PARTITIONS SELECT * FROM t1
  1693. WHERE b >= CAST('2009-04-03 00:00:01' AS DATETIME);
  1694. id select_type table partitions type possible_keys key key_len ref rows Extra
  1695. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
  1696. EXPLAIN PARTITIONS SELECT * FROM t1
  1697. WHERE b > CAST('2009-04-03 00:00:01' AS DATETIME);
  1698. id select_type table partitions type possible_keys key key_len ref rows Extra
  1699. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
  1700. EXPLAIN PARTITIONS SELECT * FROM t1
  1701. WHERE b < CAST('2009-04-02 23:59:58' AS DATETIME);
  1702. id select_type table partitions type possible_keys key key_len ref rows Extra
  1703. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 13 Using where
  1704. EXPLAIN PARTITIONS SELECT * FROM t1
  1705. WHERE b <= CAST('2009-04-02 23:59:58' AS DATETIME);
  1706. id select_type table partitions type possible_keys key key_len ref rows Extra
  1707. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 13 Using where
  1708. EXPLAIN PARTITIONS SELECT * FROM t1
  1709. WHERE b = CAST('2009-04-02 23:59:58' AS DATETIME);
  1710. id select_type table partitions type possible_keys key key_len ref rows Extra
  1711. 1 SIMPLE t1 p20090402 ALL NULL NULL NULL NULL 13 Using where
  1712. EXPLAIN PARTITIONS SELECT * FROM t1
  1713. WHERE b >= CAST('2009-04-02 23:59:58' AS DATETIME);
  1714. id select_type table partitions type possible_keys key key_len ref rows Extra
  1715. 1 SIMPLE t1 p20090401,p20090402,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
  1716. EXPLAIN PARTITIONS SELECT * FROM t1
  1717. WHERE b > CAST('2009-04-02 23:59:58' AS DATETIME);
  1718. id select_type table partitions type possible_keys key key_len ref rows Extra
  1719. 1 SIMPLE t1 p20090401,p20090402,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
  1720. DROP TABLE t1;
  1721. # Test with DATE column NULL
  1722. CREATE TABLE t1 (
  1723. a int(10) unsigned NOT NULL,
  1724. b DATE NULL
  1725. ) PARTITION BY RANGE (TO_DAYS(b))
  1726. (PARTITION p20090401 VALUES LESS THAN (TO_DAYS('2009-04-02')),
  1727. PARTITION p20090402 VALUES LESS THAN (TO_DAYS('2009-04-03')),
  1728. PARTITION p20090403 VALUES LESS THAN (TO_DAYS('2009-04-04')),
  1729. PARTITION p20090404 VALUES LESS THAN (TO_DAYS('2009-04-05')),
  1730. PARTITION p20090405 VALUES LESS THAN MAXVALUE);
  1731. INSERT INTO t1 VALUES (1, '2009-01-01'), (1, '2009-04-01'), (2, '2009-04-01'),
  1732. (1, '2009-04-02'), (2, '2009-04-02'), (1, '2009-04-03'), (2, '2009-04-03'),
  1733. (1, '2009-04-04'), (2, '2009-04-04'), (1, '2009-04-05'), (1, '2009-04-06'),
  1734. (1, '2009-04-07');
  1735. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATETIME);
  1736. id select_type table partitions type possible_keys key key_len ref rows Extra
  1737. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 5 Using where
  1738. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATETIME);
  1739. id select_type table partitions type possible_keys key key_len ref rows Extra
  1740. 1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 7 Using where
  1741. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATETIME);
  1742. id select_type table partitions type possible_keys key key_len ref rows Extra
  1743. 1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 7 Using where
  1744. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATETIME);
  1745. id select_type table partitions type possible_keys key key_len ref rows Extra
  1746. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
  1747. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATETIME);
  1748. id select_type table partitions type possible_keys key key_len ref rows Extra
  1749. 1 SIMPLE t1 p20090401,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
  1750. EXPLAIN PARTITIONS SELECT * FROM t1
  1751. WHERE b < CAST('2009-04-02 23:59:59' AS DATETIME);
  1752. id select_type table partitions type possible_keys key key_len ref rows Extra
  1753. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 12 Using where
  1754. EXPLAIN PARTITIONS SELECT * FROM t1
  1755. WHERE b <= CAST('2009-04-02 23:59:59' AS DATETIME);
  1756. id select_type table partitions type possible_keys key key_len ref rows Extra
  1757. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 12 Using where
  1758. EXPLAIN PARTITIONS SELECT * FROM t1
  1759. WHERE b = CAST('2009-04-02 23:59:59' AS DATETIME);
  1760. id select_type table partitions type possible_keys key key_len ref rows Extra
  1761. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  1762. EXPLAIN PARTITIONS SELECT * FROM t1
  1763. WHERE b >= CAST('2009-04-02 23:59:59' AS DATETIME);
  1764. id select_type table partitions type possible_keys key key_len ref rows Extra
  1765. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
  1766. EXPLAIN PARTITIONS SELECT * FROM t1
  1767. WHERE b > CAST('2009-04-02 23:59:59' AS DATETIME);
  1768. id select_type table partitions type possible_keys key key_len ref rows Extra
  1769. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
  1770. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATE);
  1771. id select_type table partitions type possible_keys key key_len ref rows Extra
  1772. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 12 Using where
  1773. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATE);
  1774. id select_type table partitions type possible_keys key key_len ref rows Extra
  1775. 1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 12 Using where
  1776. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATE);
  1777. id select_type table partitions type possible_keys key key_len ref rows Extra
  1778. 1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 12 Using where
  1779. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATE);
  1780. id select_type table partitions type possible_keys key key_len ref rows Extra
  1781. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
  1782. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATE);
  1783. id select_type table partitions type possible_keys key key_len ref rows Extra
  1784. 1 SIMPLE t1 p20090401,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
  1785. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-03 00:00:00';
  1786. id select_type table partitions type possible_keys key key_len ref rows Extra
  1787. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 12 Using where
  1788. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-03 00:00:00';
  1789. id select_type table partitions type possible_keys key key_len ref rows Extra
  1790. 1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 12 Using where
  1791. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-03 00:00:00';
  1792. id select_type table partitions type possible_keys key key_len ref rows Extra
  1793. 1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 12 Using where
  1794. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-03 00:00:00';
  1795. id select_type table partitions type possible_keys key key_len ref rows Extra
  1796. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
  1797. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-03 00:00:00';
  1798. id select_type table partitions type possible_keys key key_len ref rows Extra
  1799. 1 SIMPLE t1 p20090401,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
  1800. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-02 23:59:59';
  1801. id select_type table partitions type possible_keys key key_len ref rows Extra
  1802. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 12 Using where
  1803. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-02 23:59:59';
  1804. id select_type table partitions type possible_keys key key_len ref rows Extra
  1805. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 12 Using where
  1806. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-02 23:59:59';
  1807. id select_type table partitions type possible_keys key key_len ref rows Extra
  1808. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  1809. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-02 23:59:59';
  1810. id select_type table partitions type possible_keys key key_len ref rows Extra
  1811. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
  1812. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-02 23:59:59';
  1813. id select_type table partitions type possible_keys key key_len ref rows Extra
  1814. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
  1815. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-03';
  1816. id select_type table partitions type possible_keys key key_len ref rows Extra
  1817. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 12 Using where
  1818. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-03';
  1819. id select_type table partitions type possible_keys key key_len ref rows Extra
  1820. 1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 12 Using where
  1821. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-03';
  1822. id select_type table partitions type possible_keys key key_len ref rows Extra
  1823. 1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 12 Using where
  1824. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-03';
  1825. id select_type table partitions type possible_keys key key_len ref rows Extra
  1826. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
  1827. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-03';
  1828. id select_type table partitions type possible_keys key key_len ref rows Extra
  1829. 1 SIMPLE t1 p20090401,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
  1830. EXPLAIN PARTITIONS SELECT * FROM t1
  1831. WHERE b < CAST('2009-04-03 00:00:01' AS DATETIME);
  1832. id select_type table partitions type possible_keys key key_len ref rows Extra
  1833. 1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 12 Using where
  1834. EXPLAIN PARTITIONS SELECT * FROM t1
  1835. WHERE b <= CAST('2009-04-03 00:00:01' AS DATETIME);
  1836. id select_type table partitions type possible_keys key key_len ref rows Extra
  1837. 1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 12 Using where
  1838. EXPLAIN PARTITIONS SELECT * FROM t1
  1839. WHERE b = CAST('2009-04-03 00:00:01' AS DATETIME);
  1840. id select_type table partitions type possible_keys key key_len ref rows Extra
  1841. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  1842. EXPLAIN PARTITIONS SELECT * FROM t1
  1843. WHERE b >= CAST('2009-04-03 00:00:01' AS DATETIME);
  1844. id select_type table partitions type possible_keys key key_len ref rows Extra
  1845. 1 SIMPLE t1 p20090401,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
  1846. EXPLAIN PARTITIONS SELECT * FROM t1
  1847. WHERE b > CAST('2009-04-03 00:00:01' AS DATETIME);
  1848. id select_type table partitions type possible_keys key key_len ref rows Extra
  1849. 1 SIMPLE t1 p20090401,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
  1850. EXPLAIN PARTITIONS SELECT * FROM t1
  1851. WHERE b < CAST('2009-04-02 23:59:58' AS DATETIME);
  1852. id select_type table partitions type possible_keys key key_len ref rows Extra
  1853. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 12 Using where
  1854. EXPLAIN PARTITIONS SELECT * FROM t1
  1855. WHERE b <= CAST('2009-04-02 23:59:58' AS DATETIME);
  1856. id select_type table partitions type possible_keys key key_len ref rows Extra
  1857. 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 12 Using where
  1858. EXPLAIN PARTITIONS SELECT * FROM t1
  1859. WHERE b = CAST('2009-04-02 23:59:58' AS DATETIME);
  1860. id select_type table partitions type possible_keys key key_len ref rows Extra
  1861. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  1862. EXPLAIN PARTITIONS SELECT * FROM t1
  1863. WHERE b >= CAST('2009-04-02 23:59:58' AS DATETIME);
  1864. id select_type table partitions type possible_keys key key_len ref rows Extra
  1865. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
  1866. EXPLAIN PARTITIONS SELECT * FROM t1
  1867. WHERE b > CAST('2009-04-02 23:59:58' AS DATETIME);
  1868. id select_type table partitions type possible_keys key key_len ref rows Extra
  1869. 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
  1870. DROP TABLE t1;
  1871. # For better code coverage of the patch
  1872. CREATE TABLE t1 (
  1873. a int(10) unsigned NOT NULL,
  1874. b DATE
  1875. ) PARTITION BY RANGE ( TO_DAYS(b) )
  1876. (PARTITION p20090401 VALUES LESS THAN (TO_DAYS('2009-04-02')),
  1877. PARTITION p20090402 VALUES LESS THAN (TO_DAYS('2009-04-03')),
  1878. PARTITION p20090403 VALUES LESS THAN (TO_DAYS('2009-04-04')),
  1879. PARTITION p20090404 VALUES LESS THAN (TO_DAYS('2009-04-05')),
  1880. PARTITION p20090405 VALUES LESS THAN MAXVALUE);
  1881. INSERT INTO t1 VALUES (1, '2009-01-01'), (2, NULL);
  1882. # test with an invalid date, which lead to item->null_value is set.
  1883. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-99' AS DATETIME);
  1884. id select_type table partitions type possible_keys key key_len ref rows Extra
  1885. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  1886. Warnings:
  1887. Warning 1292 Incorrect datetime value: '2009-04-99'
  1888. DROP TABLE t1;
  1889. CREATE TABLE t1
  1890. (a INT NOT NULL AUTO_INCREMENT,
  1891. b DATETIME,
  1892. PRIMARY KEY (a,b),
  1893. KEY (b))
  1894. PARTITION BY RANGE (to_days(b))
  1895. (PARTITION p0 VALUES LESS THAN (733681) COMMENT = 'LESS THAN 2008-10-01',
  1896. PARTITION p1 VALUES LESS THAN (733712) COMMENT = 'LESS THAN 2008-11-01',
  1897. PARTITION pX VALUES LESS THAN MAXVALUE);
  1898. SELECT a,b FROM t1 WHERE b >= '2008-12-01' AND b < '2009-12-00';
  1899. a b
  1900. DROP TABLE t1;
  1901. create table t1 ( a int not null) partition by hash(a) partitions 2;
  1902. insert into t1 values (1),(2),(3);
  1903. explain select * from t1 where a=5 and a=6;
  1904. id select_type table type possible_keys key key_len ref rows Extra
  1905. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
  1906. drop table t1;
  1907. create table t1 (
  1908. a int(11) not null
  1909. ) partition by hash (a) partitions 2;
  1910. insert into t1 values (1),(2),(3);
  1911. explain partitions select * from t1 where a=1;
  1912. id select_type table partitions type possible_keys key key_len ref rows Extra
  1913. 1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where
  1914. explain partitions select * from t1 where a=2;
  1915. id select_type table partitions type possible_keys key key_len ref rows Extra
  1916. 1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
  1917. explain partitions select * from t1 where a=1 or a=2;
  1918. id select_type table partitions type possible_keys key key_len ref rows Extra
  1919. 1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 3 Using where
  1920. create table t2 (
  1921. a int not null,
  1922. b int not null
  1923. ) partition by key(a,b) partitions 2;
  1924. insert into t2 values (1,1),(2,2),(3,3);
  1925. explain partitions select * from t2 where a=1;
  1926. id select_type table partitions type possible_keys key key_len ref rows Extra
  1927. 1 SIMPLE t2 p0,p1 ALL NULL NULL NULL NULL 3 Using where
  1928. explain partitions select * from t2 where b=1;
  1929. id select_type table partitions type possible_keys key key_len ref rows Extra
  1930. 1 SIMPLE t2 p0,p1 ALL NULL NULL NULL NULL 3 Using where
  1931. explain partitions select * from t2 where a=1 and b=1;
  1932. id select_type table partitions type possible_keys key key_len ref rows Extra
  1933. 1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 3 Using where
  1934. create table t3 (
  1935. a int
  1936. )
  1937. partition by range (a*1) (
  1938. partition p0 values less than (10),
  1939. partition p1 values less than (20)
  1940. );
  1941. insert into t3 values (5),(15);
  1942. explain partitions select * from t3 where a=11;
  1943. id select_type table partitions type possible_keys key key_len ref rows Extra
  1944. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  1945. explain partitions select * from t3 where a=10;
  1946. id select_type table partitions type possible_keys key key_len ref rows Extra
  1947. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  1948. explain partitions select * from t3 where a=20;
  1949. id select_type table partitions type possible_keys key key_len ref rows Extra
  1950. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  1951. explain partitions select * from t3 where a=30;
  1952. id select_type table partitions type possible_keys key key_len ref rows Extra
  1953. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  1954. create table t4 (a int not null, b int not null) partition by LIST (a+b) (
  1955. partition p0 values in (12),
  1956. partition p1 values in (14)
  1957. );
  1958. insert into t4 values (10,2), (10,4);
  1959. explain partitions select * from t4 where (a=10 and b=1) or (a=10 and b=2);
  1960. id select_type table partitions type possible_keys key key_len ref rows Extra
  1961. 1 SIMPLE t4 p0 system NULL NULL NULL NULL 1
  1962. explain partitions select * from t4
  1963. where (a=10 and b=1) or (a=10 and b=2) or (a=10 and b = 3);
  1964. id select_type table partitions type possible_keys key key_len ref rows Extra
  1965. 1 SIMPLE t4 p0 system NULL NULL NULL NULL 1
  1966. explain partitions select * from t4 where (a=10 and b=2) or (a=10 and b=3)
  1967. or (a=10 and b = 4);
  1968. id select_type table partitions type possible_keys key key_len ref rows Extra
  1969. 1 SIMPLE t4 p0,p1 ALL NULL NULL NULL NULL 2 Using where
  1970. explain partitions select * from t4 where (a=10 and b=1) or a=11;
  1971. id select_type table partitions type possible_keys key key_len ref rows Extra
  1972. 1 SIMPLE t4 p0,p1 ALL NULL NULL NULL NULL 2 Using where
  1973. explain partitions select * from t4 where (a=10 and b=2) or a=11;
  1974. id select_type table partitions type possible_keys key key_len ref rows Extra
  1975. 1 SIMPLE t4 p0,p1 ALL NULL NULL NULL NULL 2 Using where
  1976. drop table t1, t2, t3, t4;
  1977. create table t5 (a int not null, b int not null,
  1978. c int not null, d int not null)
  1979. partition by LIST(a+b) subpartition by HASH (c+d) subpartitions 2
  1980. (
  1981. partition p0 values in (12),
  1982. partition p1 values in (14)
  1983. );
  1984. insert into t5 values (10,2,0,0), (10,4,0,0), (10,2,0,1), (10,4,0,1);
  1985. explain partitions select * from t5;
  1986. id select_type table partitions type possible_keys key key_len ref rows Extra
  1987. 1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 4
  1988. explain partitions select * from t5
  1989. where (a=10 and b=1) or (a=10 and b=2) or (a=10 and b = 3);
  1990. id select_type table partitions type possible_keys key key_len ref rows Extra
  1991. 1 SIMPLE t5 p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 4 Using where
  1992. explain partitions select * from t5 where (a=10 and b=2) or (a=10 and b=3)
  1993. or (a=10 and b = 4);
  1994. id select_type table partitions type possible_keys key key_len ref rows Extra
  1995. 1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
  1996. explain partitions select * from t5 where (c=1 and d=1);
  1997. id select_type table partitions type possible_keys key key_len ref rows Extra
  1998. 1 SIMPLE t5 p0_p0sp0,p1_p1sp0 ALL NULL NULL NULL NULL 4 Using where
  1999. explain partitions select * from t5 where (c=2 and d=1);
  2000. id select_type table partitions type possible_keys key key_len ref rows Extra
  2001. 1 SIMPLE t5 p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
  2002. explain partitions select * from t5 where (a=10 and b=2 and c=1 and d=1) or
  2003. (c=2 and d=1);
  2004. id select_type table partitions type possible_keys key key_len ref rows Extra
  2005. 1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
  2006. explain partitions select * from t5 where (a=10 and b=2 and c=1 and d=1) or
  2007. (b=2 and c=2 and d=1);
  2008. id select_type table partitions type possible_keys key key_len ref rows Extra
  2009. 1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
  2010. create table t6 (a int not null) partition by LIST(a) (
  2011. partition p1 values in (1),
  2012. partition p3 values in (3),
  2013. partition p5 values in (5),
  2014. partition p7 values in (7),
  2015. partition p9 values in (9)
  2016. );
  2017. insert into t6 values (1),(3),(5);
  2018. explain partitions select * from t6 where a < 1;
  2019. id select_type table partitions type possible_keys key key_len ref rows Extra
  2020. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2021. explain partitions select * from t6 where a <= 1;
  2022. id select_type table partitions type possible_keys key key_len ref rows Extra
  2023. 1 SIMPLE t6 p1 system NULL NULL NULL NULL 1
  2024. explain partitions select * from t6 where a > 9;
  2025. id select_type table partitions type possible_keys key key_len ref rows Extra
  2026. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2027. explain partitions select * from t6 where a >= 9;
  2028. id select_type table partitions type possible_keys key key_len ref rows Extra
  2029. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2030. explain partitions select * from t6 where a > 0 and a < 5;
  2031. id select_type table partitions type possible_keys key key_len ref rows Extra
  2032. 1 SIMPLE t6 p1,p3 ALL NULL NULL NULL NULL 2 Using where
  2033. explain partitions select * from t6 where a > 5 and a < 12;
  2034. id select_type table partitions type possible_keys key key_len ref rows Extra
  2035. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2036. explain partitions select * from t6 where a > 3 and a < 8 ;
  2037. id select_type table partitions type possible_keys key key_len ref rows Extra
  2038. 1 SIMPLE t6 p5,p7 system NULL NULL NULL NULL 1
  2039. explain partitions select * from t6 where a >= 0 and a <= 5;
  2040. id select_type table partitions type possible_keys key key_len ref rows Extra
  2041. 1 SIMPLE t6 p1,p3,p5 ALL NULL NULL NULL NULL 3 Using where
  2042. explain partitions select * from t6 where a >= 5 and a <= 12;
  2043. id select_type table partitions type possible_keys key key_len ref rows Extra
  2044. 1 SIMPLE t6 p5,p7,p9 system NULL NULL NULL NULL 1
  2045. explain partitions select * from t6 where a >= 3 and a <= 8;
  2046. id select_type table partitions type possible_keys key key_len ref rows Extra
  2047. 1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 3 Using where
  2048. explain partitions select * from t6 where a > 3 and a < 5;
  2049. id select_type table partitions type possible_keys key key_len ref rows Extra
  2050. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2051. drop table t6;
  2052. create table t6 (a int unsigned not null) partition by LIST(a) (
  2053. partition p1 values in (1),
  2054. partition p3 values in (3),
  2055. partition p5 values in (5),
  2056. partition p7 values in (7),
  2057. partition p9 values in (9)
  2058. );
  2059. insert into t6 values (1),(3),(5);
  2060. explain partitions select * from t6 where a < 1;
  2061. id select_type table partitions type possible_keys key key_len ref rows Extra
  2062. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2063. explain partitions select * from t6 where a <= 1;
  2064. id select_type table partitions type possible_keys key key_len ref rows Extra
  2065. 1 SIMPLE t6 p1 system NULL NULL NULL NULL 1
  2066. explain partitions select * from t6 where a > 9;
  2067. id select_type table partitions type possible_keys key key_len ref rows Extra
  2068. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2069. explain partitions select * from t6 where a >= 9;
  2070. id select_type table partitions type possible_keys key key_len ref rows Extra
  2071. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2072. explain partitions select * from t6 where a > 0 and a < 5;
  2073. id select_type table partitions type possible_keys key key_len ref rows Extra
  2074. 1 SIMPLE t6 p1,p3 ALL NULL NULL NULL NULL 2 Using where
  2075. explain partitions select * from t6 where a > 5 and a < 12;
  2076. id select_type table partitions type possible_keys key key_len ref rows Extra
  2077. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2078. explain partitions select * from t6 where a > 3 and a < 8 ;
  2079. id select_type table partitions type possible_keys key key_len ref rows Extra
  2080. 1 SIMPLE t6 p5,p7 system NULL NULL NULL NULL 1
  2081. explain partitions select * from t6 where a >= 0 and a <= 5;
  2082. id select_type table partitions type possible_keys key key_len ref rows Extra
  2083. 1 SIMPLE t6 p1,p3,p5 ALL NULL NULL NULL NULL 3 Using where
  2084. explain partitions select * from t6 where a >= 5 and a <= 12;
  2085. id select_type table partitions type possible_keys key key_len ref rows Extra
  2086. 1 SIMPLE t6 p5,p7,p9 system NULL NULL NULL NULL 1
  2087. explain partitions select * from t6 where a >= 3 and a <= 8;
  2088. id select_type table partitions type possible_keys key key_len ref rows Extra
  2089. 1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 3 Using where
  2090. explain partitions select * from t6 where a > 3 and a < 5;
  2091. id select_type table partitions type possible_keys key key_len ref rows Extra
  2092. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2093. create table t7 (a int not null) partition by RANGE(a) (
  2094. partition p10 values less than (10),
  2095. partition p30 values less than (30),
  2096. partition p50 values less than (50),
  2097. partition p70 values less than (70),
  2098. partition p90 values less than (90)
  2099. );
  2100. insert into t7 values (10),(30),(50);
  2101. explain partitions select * from t7 where a < 5;
  2102. id select_type table partitions type possible_keys key key_len ref rows Extra
  2103. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2104. explain partitions select * from t7 where a < 10;
  2105. id select_type table partitions type possible_keys key key_len ref rows Extra
  2106. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2107. explain partitions select * from t7 where a <= 10;
  2108. id select_type table partitions type possible_keys key key_len ref rows Extra
  2109. 1 SIMPLE t7 p10,p30 system NULL NULL NULL NULL 1
  2110. explain partitions select * from t7 where a = 10;
  2111. id select_type table partitions type possible_keys key key_len ref rows Extra
  2112. 1 SIMPLE t7 p30 system NULL NULL NULL NULL 1
  2113. explain partitions select * from t7 where a < 90;
  2114. id select_type table partitions type possible_keys key key_len ref rows Extra
  2115. 1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
  2116. explain partitions select * from t7 where a = 90;
  2117. id select_type table partitions type possible_keys key key_len ref rows Extra
  2118. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2119. explain partitions select * from t7 where a > 90;
  2120. id select_type table partitions type possible_keys key key_len ref rows Extra
  2121. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2122. explain partitions select * from t7 where a >= 90;
  2123. id select_type table partitions type possible_keys key key_len ref rows Extra
  2124. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2125. explain partitions select * from t7 where a > 11 and a < 29;
  2126. id select_type table partitions type possible_keys key key_len ref rows Extra
  2127. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2128. drop table t7;
  2129. create table t7 (a int unsigned not null) partition by RANGE(a) (
  2130. partition p10 values less than (10),
  2131. partition p30 values less than (30),
  2132. partition p50 values less than (50),
  2133. partition p70 values less than (70),
  2134. partition p90 values less than (90)
  2135. );
  2136. insert into t7 values (10),(30),(50);
  2137. explain partitions select * from t7 where a < 5;
  2138. id select_type table partitions type possible_keys key key_len ref rows Extra
  2139. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2140. explain partitions select * from t7 where a < 10;
  2141. id select_type table partitions type possible_keys key key_len ref rows Extra
  2142. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2143. explain partitions select * from t7 where a <= 10;
  2144. id select_type table partitions type possible_keys key key_len ref rows Extra
  2145. 1 SIMPLE t7 p10,p30 system NULL NULL NULL NULL 1
  2146. explain partitions select * from t7 where a = 10;
  2147. id select_type table partitions type possible_keys key key_len ref rows Extra
  2148. 1 SIMPLE t7 p30 system NULL NULL NULL NULL 1
  2149. explain partitions select * from t7 where a < 90;
  2150. id select_type table partitions type possible_keys key key_len ref rows Extra
  2151. 1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
  2152. explain partitions select * from t7 where a = 90;
  2153. id select_type table partitions type possible_keys key key_len ref rows Extra
  2154. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2155. explain partitions select * from t7 where a > 90;
  2156. id select_type table partitions type possible_keys key key_len ref rows Extra
  2157. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2158. explain partitions select * from t7 where a >= 90;
  2159. id select_type table partitions type possible_keys key key_len ref rows Extra
  2160. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2161. explain partitions select * from t7 where a > 11 and a < 29;
  2162. id select_type table partitions type possible_keys key key_len ref rows Extra
  2163. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2164. create table t8 (a date not null) partition by RANGE(YEAR(a)) (
  2165. partition p0 values less than (1980),
  2166. partition p1 values less than (1990),
  2167. partition p2 values less than (2000)
  2168. );
  2169. insert into t8 values ('1985-05-05'),('1995-05-05');
  2170. explain partitions select * from t8 where a < '1980-02-02';
  2171. id select_type table partitions type possible_keys key key_len ref rows Extra
  2172. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2173. create table t9 (a date not null) partition by RANGE(TO_DAYS(a)) (
  2174. partition p0 values less than (732299), -- 2004-12-19
  2175. partition p1 values less than (732468), -- 2005-06-06
  2176. partition p2 values less than (732664) -- 2005-12-19
  2177. );
  2178. insert into t9 values ('2005-05-05'), ('2005-04-04');
  2179. explain partitions select * from t9 where a < '2004-12-19';
  2180. id select_type table partitions type possible_keys key key_len ref rows Extra
  2181. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2182. explain partitions select * from t9 where a <= '2004-12-19';
  2183. id select_type table partitions type possible_keys key key_len ref rows Extra
  2184. 1 SIMPLE t9 p0,p1 ALL NULL NULL NULL NULL 2 Using where
  2185. drop table t5,t6,t7,t8,t9;
  2186. create table t1 (
  2187. a1 int not null
  2188. )
  2189. partition by range (a1) (
  2190. partition p0 values less than (3),
  2191. partition p1 values less than (6),
  2192. partition p2 values less than (9)
  2193. );
  2194. insert into t1 values (1),(2),(3);
  2195. explain partitions select * from t1 where a1 > 3;
  2196. id select_type table partitions type possible_keys key key_len ref rows Extra
  2197. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2198. explain partitions select * from t1 where a1 >= 3;
  2199. id select_type table partitions type possible_keys key key_len ref rows Extra
  2200. 1 SIMPLE t1 p1,p2 system NULL NULL NULL NULL 1
  2201. explain partitions select * from t1 where a1 < 3 and a1 > 3;
  2202. id select_type table partitions type possible_keys key key_len ref rows Extra
  2203. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2204. drop table t1;
  2205. create table t3 (a int, b int)
  2206. partition by list(a) subpartition by hash(b) subpartitions 4 (
  2207. partition p0 values in (1),
  2208. partition p1 values in (2),
  2209. partition p2 values in (3),
  2210. partition p3 values in (4)
  2211. );
  2212. insert into t3 values (1,1),(2,2),(3,3);
  2213. explain partitions select * from t3 where a=2 or b=1;
  2214. id select_type table partitions type possible_keys key key_len ref rows Extra
  2215. 1 SIMPLE t3 p0_p0sp1,p1_p1sp0,p1_p1sp1,p1_p1sp2,p1_p1sp3,p2_p2sp1,p3_p3sp1 ALL NULL NULL NULL NULL 2 Using where
  2216. explain partitions select * from t3 where a=4 or b=2;
  2217. id select_type table partitions type possible_keys key key_len ref rows Extra
  2218. 1 SIMPLE t3 p0_p0sp2,p1_p1sp2,p2_p2sp2,p3_p3sp0,p3_p3sp1,p3_p3sp2,p3_p3sp3 system NULL NULL NULL NULL 1
  2219. explain partitions select * from t3 where (a=2 or b=1) and (a=4 or b=2) ;
  2220. id select_type table partitions type possible_keys key key_len ref rows Extra
  2221. 1 SIMPLE t3 p1_p1sp2,p3_p3sp1 system NULL NULL NULL NULL 1
  2222. drop table t3;
  2223. create table t1 (a int) partition by hash(a) partitions 2;
  2224. insert into t1 values (1),(2);
  2225. explain partitions select * from t1 where a is null;
  2226. id select_type table partitions type possible_keys key key_len ref rows Extra
  2227. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2228. explain partitions select * from t1 where a is not null;
  2229. id select_type table partitions type possible_keys key key_len ref rows Extra
  2230. 1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 2 Using where
  2231. drop table t1;
  2232. create table t1 (a int not null, b int not null, key(a), key(b))
  2233. partition by hash(a) partitions 4;
  2234. insert into t1 values (1,1),(2,2),(3,3),(4,4);
  2235. explain partitions
  2236. select * from t1 X, t1 Y
  2237. where X.b = Y.b and (X.a=1 or X.a=2) and (Y.a=2 or Y.a=3);
  2238. id select_type table partitions type possible_keys key key_len ref rows Extra
  2239. 1 SIMPLE X p1,p2 ALL a,b NULL NULL NULL 2 Using where
  2240. 1 SIMPLE Y p2,p3 ref a,b b 4 test.X.b 2 Using where
  2241. explain partitions
  2242. select * from t1 X, t1 Y where X.a = Y.a and (X.a=1 or X.a=2);
  2243. id select_type table partitions type possible_keys key key_len ref rows Extra
  2244. 1 SIMPLE X p1,p2 ALL a NULL NULL NULL 4 Using where
  2245. 1 SIMPLE Y p1,p2 ref a a 4 test.X.a 2
  2246. drop table t1;
  2247. create table t1 (a int) partition by hash(a) partitions 20;
  2248. insert into t1 values (1),(2),(3);
  2249. explain partitions select * from t1 where a > 1 and a < 3;
  2250. id select_type table partitions type possible_keys key key_len ref rows Extra
  2251. 1 SIMPLE t1 p2 system NULL NULL NULL NULL 1
  2252. explain partitions select * from t1 where a >= 1 and a < 3;
  2253. id select_type table partitions type possible_keys key key_len ref rows Extra
  2254. 1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 2 Using where
  2255. explain partitions select * from t1 where a > 1 and a <= 3;
  2256. id select_type table partitions type possible_keys key key_len ref rows Extra
  2257. 1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 3 Using where
  2258. explain partitions select * from t1 where a >= 1 and a <= 3;
  2259. id select_type table partitions type possible_keys key key_len ref rows Extra
  2260. 1 SIMPLE t1 p1,p2,p3 ALL NULL NULL NULL NULL 3 Using where
  2261. drop table t1;
  2262. create table t1 (a int, b int)
  2263. partition by list(a) subpartition by hash(b) subpartitions 20
  2264. (
  2265. partition p0 values in (0),
  2266. partition p1 values in (1),
  2267. partition p2 values in (2),
  2268. partition p3 values in (3)
  2269. );
  2270. insert into t1 values (1,1),(2,2),(3,3);
  2271. explain partitions select * from t1 where b > 1 and b < 3;
  2272. id select_type table partitions type possible_keys key key_len ref rows Extra
  2273. 1 SIMPLE t1 p0_p0sp2,p1_p1sp2,p2_p2sp2,p3_p3sp2 system NULL NULL NULL NULL 1
  2274. explain partitions select * from t1 where b > 1 and b < 3 and (a =1 or a =2);
  2275. id select_type table partitions type possible_keys key key_len ref rows Extra
  2276. 1 SIMPLE t1 p1_p1sp2,p2_p2sp2 system NULL NULL NULL NULL 1
  2277. drop table t1;
  2278. create table t1 (a int) partition by list(a) (
  2279. partition p0 values in (1,2),
  2280. partition p1 values in (3,4)
  2281. );
  2282. insert into t1 values (1),(1),(2),(2),(3),(4),(3),(4);
  2283. flush status;
  2284. update t1 set a=100 where a=5;
  2285. show status like 'Handler_read_rnd_next';
  2286. Variable_name Value
  2287. Handler_read_rnd_next 0
  2288. flush status;
  2289. update t1 set a=100 where a+1=5+1;
  2290. show status like 'Handler_read_rnd_next';
  2291. Variable_name Value
  2292. Handler_read_rnd_next 10
  2293. flush status;
  2294. delete from t1 where a=5;
  2295. show status like 'Handler_read_rnd_next';
  2296. Variable_name Value
  2297. Handler_read_rnd_next 0
  2298. flush status;
  2299. delete from t1 where a+1=5+1;
  2300. show status like 'Handler_read_rnd_next';
  2301. Variable_name Value
  2302. Handler_read_rnd_next 10
  2303. create table t2 like t1;
  2304. insert into t2 select * from t2;
  2305. flush status;
  2306. update t1,t2 set t1.a=1000, t2.a=1000 where t1.a=5 and t2.a=5;
  2307. show status like 'Handler_read_rnd_next';
  2308. Variable_name Value
  2309. Handler_read_rnd_next 0
  2310. flush status;
  2311. delete t1,t2 from t1, t2 where t1.a=5 and t2.a=5;
  2312. show status like 'Handler_read_rnd_next';
  2313. Variable_name Value
  2314. Handler_read_rnd_next 0
  2315. drop table t1,t2;
  2316. CREATE TABLE `t1` (
  2317. `a` int(11) default NULL
  2318. );
  2319. INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
  2320. CREATE TABLE `t2` (
  2321. `a` int(11) default NULL,
  2322. KEY `a` (`a`)
  2323. ) ;
  2324. insert into t2 select A.a + 10*(B.a + 10* C.a) from t1 A, t1 B, t1 C ;
  2325. insert into t1 select a from t2;
  2326. drop table t2;
  2327. CREATE TABLE `t2` (
  2328. `a` int(11) default NULL,
  2329. `b` int(11) default NULL
  2330. )
  2331. PARTITION BY RANGE (a) (
  2332. PARTITION p0 VALUES LESS THAN (200),
  2333. PARTITION p1 VALUES LESS THAN (400),
  2334. PARTITION p2 VALUES LESS THAN (600),
  2335. PARTITION p3 VALUES LESS THAN (800),
  2336. PARTITION p4 VALUES LESS THAN (1001));
  2337. insert into t2 select a,1 from t1 where a < 200;
  2338. insert into t2 select a,2 from t1 where a >= 200 and a < 400;
  2339. insert into t2 select a,3 from t1 where a >= 400 and a < 600;
  2340. insert into t2 select a,4 from t1 where a >= 600 and a < 800;
  2341. insert into t2 select a,5 from t1 where a >= 800 and a < 1001;
  2342. explain partitions select * from t2;
  2343. id select_type table partitions type possible_keys key key_len ref rows Extra
  2344. 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL NULL NULL NULL NULL 1010
  2345. explain partitions select * from t2 where a < 801 and a > 200;
  2346. id select_type table partitions type possible_keys key key_len ref rows Extra
  2347. 1 SIMPLE t2 p1,p2,p3,p4 ALL NULL NULL NULL NULL 1010 Using where
  2348. explain partitions select * from t2 where a < 801 and a > 800;
  2349. id select_type table partitions type possible_keys key key_len ref rows Extra
  2350. 1 SIMPLE t2 p4 ALL NULL NULL NULL NULL 1010 Using where
  2351. explain partitions select * from t2 where a > 600;
  2352. id select_type table partitions type possible_keys key key_len ref rows Extra
  2353. 1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where
  2354. explain partitions select * from t2 where a > 600 and b = 1;
  2355. id select_type table partitions type possible_keys key key_len ref rows Extra
  2356. 1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where
  2357. explain partitions select * from t2 where a > 600 and b = 4;
  2358. id select_type table partitions type possible_keys key key_len ref rows Extra
  2359. 1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where
  2360. explain partitions select * from t2 where a > 600 and b = 5;
  2361. id select_type table partitions type possible_keys key key_len ref rows Extra
  2362. 1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where
  2363. explain partitions select * from t2 where b = 5;
  2364. id select_type table partitions type possible_keys key key_len ref rows Extra
  2365. 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL NULL NULL NULL NULL 1010 Using where
  2366. flush status;
  2367. update t2 set b = 100 where b = 6;
  2368. show status like 'Handler_read_rnd_next';
  2369. Variable_name Value
  2370. Handler_read_rnd_next 1015
  2371. flush status;
  2372. update t2 set a = 1002 where a = 1001;
  2373. show status like 'Handler_read_rnd_next';
  2374. Variable_name Value
  2375. Handler_read_rnd_next 0
  2376. flush status;
  2377. update t2 set b = 6 where a = 600;
  2378. show status like 'Handler_read_rnd_next';
  2379. Variable_name Value
  2380. Handler_read_rnd_next 201
  2381. flush status;
  2382. update t2 set b = 6 where a > 600 and a < 800;
  2383. show status like 'Handler_read_rnd_next';
  2384. Variable_name Value
  2385. Handler_read_rnd_next 201
  2386. flush status;
  2387. delete from t2 where a > 600;
  2388. show status like 'Handler_read_rnd_next';
  2389. Variable_name Value
  2390. Handler_read_rnd_next 402
  2391. drop table t2;
  2392. CREATE TABLE `t2` (
  2393. `a` int(11) default NULL,
  2394. `b` int(11) default NULL,
  2395. index (b)
  2396. )
  2397. PARTITION BY RANGE (a) (
  2398. PARTITION p0 VALUES LESS THAN (200),
  2399. PARTITION p1 VALUES LESS THAN (400),
  2400. PARTITION p2 VALUES LESS THAN (600),
  2401. PARTITION p3 VALUES LESS THAN (800),
  2402. PARTITION p4 VALUES LESS THAN (1001));
  2403. insert into t2 select a,1 from t1 where a < 100;
  2404. insert into t2 select a,2 from t1 where a >= 200 and a < 300;
  2405. insert into t2 select a,3 from t1 where a >= 300 and a < 400;
  2406. insert into t2 select a,4 from t1 where a >= 400 and a < 500;
  2407. insert into t2 select a,5 from t1 where a >= 500 and a < 600;
  2408. insert into t2 select a,6 from t1 where a >= 600 and a < 700;
  2409. insert into t2 select a,7 from t1 where a >= 700 and a < 800;
  2410. insert into t2 select a,8 from t1 where a >= 800 and a < 900;
  2411. insert into t2 select a,9 from t1 where a >= 900 and a < 1001;
  2412. explain partitions select * from t2;
  2413. id select_type table partitions type possible_keys key key_len ref rows Extra
  2414. 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL NULL NULL NULL NULL 910
  2415. explain partitions select * from t2 where a = 101;
  2416. id select_type table partitions type possible_keys key key_len ref rows Extra
  2417. 1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 910 Using where
  2418. explain partitions select * from t2 where a = 550;
  2419. id select_type table partitions type possible_keys key key_len ref rows Extra
  2420. 1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 910 Using where
  2421. explain partitions select * from t2 where a = 833;
  2422. id select_type table partitions type possible_keys key key_len ref rows Extra
  2423. 1 SIMPLE t2 p4 ALL NULL NULL NULL NULL 910 Using where
  2424. explain partitions select * from t2 where (a = 100 OR a = 900);
  2425. id select_type table partitions type possible_keys key key_len ref rows Extra
  2426. 1 SIMPLE t2 p0,p4 ALL NULL NULL NULL NULL 910 Using where
  2427. explain partitions select * from t2 where (a > 100 AND a < 600);
  2428. id select_type table partitions type possible_keys key key_len ref rows Extra
  2429. 1 SIMPLE t2 p0,p1,p2 ALL NULL NULL NULL NULL 910 Using where
  2430. explain partitions select * from t2 where b = 4;
  2431. id select_type table partitions type possible_keys key key_len ref rows Extra
  2432. 1 SIMPLE t2 p0,p1,p2,p3,p4 ref b b 5 const 76 Using where
  2433. explain extended select * from t2 where b = 6;
  2434. id select_type table type possible_keys key key_len ref rows filtered Extra
  2435. 1 SIMPLE t2 ref b b 5 const 76 100.00 Using where
  2436. Warnings:
  2437. Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = 6)
  2438. explain partitions select * from t2 where b = 6;
  2439. id select_type table partitions type possible_keys key key_len ref rows Extra
  2440. 1 SIMPLE t2 p0,p1,p2,p3,p4 ref b b 5 const 76 Using where
  2441. explain extended select * from t2 where b in (1,3,5);
  2442. id select_type table type possible_keys key key_len ref rows filtered Extra
  2443. 1 SIMPLE t2 ALL b NULL NULL NULL 910 40.66 Using where
  2444. Warnings:
  2445. Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` in (1,3,5))
  2446. explain partitions select * from t2 where b in (1,3,5);
  2447. id select_type table partitions type possible_keys key key_len ref rows Extra
  2448. 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL b NULL NULL NULL 910 Using where
  2449. explain extended select * from t2 where b in (2,4,6);
  2450. id select_type table type possible_keys key key_len ref rows filtered Extra
  2451. 1 SIMPLE t2 ALL b NULL NULL NULL 910 25.05 Using where
  2452. Warnings:
  2453. Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` in (2,4,6))
  2454. explain partitions select * from t2 where b in (2,4,6);
  2455. id select_type table partitions type possible_keys key key_len ref rows Extra
  2456. 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL b NULL NULL NULL 910 Using where
  2457. explain extended select * from t2 where b in (7,8,9);
  2458. id select_type table type possible_keys key key_len ref rows filtered Extra
  2459. 1 SIMPLE t2 ALL b NULL NULL NULL 910 36.70 Using where
  2460. Warnings:
  2461. Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` in (7,8,9))
  2462. explain partitions select * from t2 where b in (7,8,9);
  2463. id select_type table partitions type possible_keys key key_len ref rows Extra
  2464. 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL b NULL NULL NULL 910 Using where
  2465. explain extended select * from t2 where b > 5;
  2466. id select_type table type possible_keys key key_len ref rows filtered Extra
  2467. 1 SIMPLE t2 ALL b NULL NULL NULL 910 44.84 Using where
  2468. Warnings:
  2469. Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` > 5)
  2470. explain partitions select * from t2 where b > 5;
  2471. id select_type table partitions type possible_keys key key_len ref rows Extra
  2472. 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL b NULL NULL NULL 910 Using where
  2473. explain extended select * from t2 where b > 5 and b < 8;
  2474. id select_type table type possible_keys key key_len ref rows filtered Extra
  2475. 1 SIMPLE t2 ALL b NULL NULL NULL 910 22.09 Using where
  2476. Warnings:
  2477. Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where ((`test`.`t2`.`b` > 5) and (`test`.`t2`.`b` < 8))
  2478. explain partitions select * from t2 where b > 5 and b < 8;
  2479. id select_type table partitions type possible_keys key key_len ref rows Extra
  2480. 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL b NULL NULL NULL 910 Using where
  2481. explain extended select * from t2 where b > 5 and b < 7;
  2482. id select_type table type possible_keys key key_len ref rows filtered Extra
  2483. 1 SIMPLE t2 range b b 5 NULL 76 100.00 Using where
  2484. Warnings:
  2485. Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where ((`test`.`t2`.`b` > 5) and (`test`.`t2`.`b` < 7))
  2486. explain partitions select * from t2 where b > 5 and b < 7;
  2487. id select_type table partitions type possible_keys key key_len ref rows Extra
  2488. 1 SIMPLE t2 p0,p1,p2,p3,p4 range b b 5 NULL 76 Using where
  2489. explain extended select * from t2 where b > 0 and b < 5;
  2490. id select_type table type possible_keys key key_len ref rows filtered Extra
  2491. 1 SIMPLE t2 ALL b NULL NULL NULL 910 41.65 Using where
  2492. Warnings:
  2493. Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where ((`test`.`t2`.`b` > 0) and (`test`.`t2`.`b` < 5))
  2494. explain partitions select * from t2 where b > 0 and b < 5;
  2495. id select_type table partitions type possible_keys key key_len ref rows Extra
  2496. 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL b NULL NULL NULL 910 Using where
  2497. flush status;
  2498. update t2 set a = 111 where b = 10;
  2499. show status like 'Handler_read_rnd_next';
  2500. Variable_name Value
  2501. Handler_read_rnd_next 0
  2502. show status like 'Handler_read_key';
  2503. Variable_name Value
  2504. Handler_read_key 5
  2505. flush status;
  2506. update t2 set a = 111 where b in (5,6);
  2507. show status like 'Handler_read_rnd_next';
  2508. Variable_name Value
  2509. Handler_read_rnd_next 915
  2510. show status like 'Handler_read_key';
  2511. Variable_name Value
  2512. Handler_read_key 0
  2513. flush status;
  2514. update t2 set a = 222 where b = 7;
  2515. show status like 'Handler_read_rnd_next';
  2516. Variable_name Value
  2517. Handler_read_rnd_next 0
  2518. show status like 'Handler_read_key';
  2519. Variable_name Value
  2520. Handler_read_key 5
  2521. flush status;
  2522. delete from t2 where b = 7;
  2523. show status like 'Handler_read_rnd_next';
  2524. Variable_name Value
  2525. Handler_read_rnd_next 0
  2526. show status like 'Handler_read_key';
  2527. Variable_name Value
  2528. Handler_read_key 5
  2529. flush status;
  2530. delete from t2 where b > 5;
  2531. show status like 'Handler_read_rnd_next';
  2532. Variable_name Value
  2533. Handler_read_rnd_next 1215
  2534. show status like 'Handler_read_key';
  2535. Variable_name Value
  2536. Handler_read_key 0
  2537. show status like 'Handler_read_prev';
  2538. Variable_name Value
  2539. Handler_read_prev 0
  2540. show status like 'Handler_read_next';
  2541. Variable_name Value
  2542. Handler_read_next 0
  2543. flush status;
  2544. delete from t2 where b < 5 or b > 3;
  2545. show status like 'Handler_read_rnd_next';
  2546. Variable_name Value
  2547. Handler_read_rnd_next 1215
  2548. show status like 'Handler_read_key';
  2549. Variable_name Value
  2550. Handler_read_key 0
  2551. show status like 'Handler_read_prev';
  2552. Variable_name Value
  2553. Handler_read_prev 0
  2554. show status like 'Handler_read_next';
  2555. Variable_name Value
  2556. Handler_read_next 0
  2557. drop table t1, t2;
  2558. create table t1 ( f_int1 mediumint, f_int2 integer)
  2559. partition by list(mod(f_int1,4)) (
  2560. partition p_3 values in (-3),
  2561. partition p_2 values in (-2),
  2562. partition p_1 values in (-1),
  2563. partition p0 values in (0),
  2564. partition p1 values in (1),
  2565. partition p2 values in (2),
  2566. partition p3 values in (3)
  2567. );
  2568. insert into t1 values (9, 9), (8, 8), (7, 7), (6, 6), (5, 5),
  2569. (4, 4), (3, 3), (2, 2), (1, 1);
  2570. select * from t1 where f_int1 between 5 and 15 order by f_int1;
  2571. f_int1 f_int2
  2572. 5 5
  2573. 6 6
  2574. 7 7
  2575. 8 8
  2576. 9 9
  2577. drop table t1;
  2578. create table t1 (f_int1 integer) partition by list(abs(mod(f_int1,2)))
  2579. subpartition by hash(f_int1) subpartitions 2
  2580. (
  2581. partition part1 values in (0),
  2582. partition part2 values in (1),
  2583. partition part4 values in (null)
  2584. );
  2585. insert into t1 set f_int1 = null;
  2586. select * from t1 where f_int1 is null;
  2587. f_int1
  2588. NULL
  2589. explain partitions select * from t1 where f_int1 is null;
  2590. id select_type table partitions type possible_keys key key_len ref rows Extra
  2591. 1 SIMPLE t1 part4_part4sp0 system NULL NULL NULL NULL 1
  2592. drop table t1;
  2593. create table t1 (a int not null, b int not null)
  2594. partition by list(a)
  2595. subpartition by hash(b) subpartitions 4
  2596. (
  2597. partition p0 values in (1),
  2598. partition p1 values in (2),
  2599. partition p2 values in (3)
  2600. );
  2601. insert into t1 values (1,1),(1,2),(1,3),(1,4),
  2602. (2,1),(2,2),(2,3),(2,4);
  2603. explain partitions select * from t1 where a=1 AND (b=1 OR b=2);
  2604. id select_type table partitions type possible_keys key key_len ref rows Extra
  2605. 1 SIMPLE t1 p0_p0sp1,p0_p0sp2 ALL NULL NULL NULL NULL 2 Using where
  2606. drop table t1;
  2607. create table t1 (a int, b int not null)
  2608. partition by list(a)
  2609. subpartition by hash(b) subpartitions 2
  2610. (
  2611. partition p0 values in (1),
  2612. partition p1 values in (2),
  2613. partition p2 values in (3),
  2614. partition pn values in (NULL)
  2615. );
  2616. insert into t1 values (1,1),(1,2),(1,3),(1,4),
  2617. (2,1),(2,2),(2,3),(2,4), (NULL,1);
  2618. explain partitions select * from t1 where a IS NULL AND (b=1 OR b=2);
  2619. id select_type table partitions type possible_keys key key_len ref rows Extra
  2620. 1 SIMPLE t1 pn_pnsp0,pn_pnsp1 system NULL NULL NULL NULL 1
  2621. explain partitions select * from t1 where (a IS NULL or a < 1) AND (b=1 OR b=2);
  2622. id select_type table partitions type possible_keys key key_len ref rows Extra
  2623. 1 SIMPLE t1 pn_pnsp0,pn_pnsp1 system NULL NULL NULL NULL 1
  2624. explain partitions select * from t1 where (a IS NULL or a < 2) AND (b=1 OR b=2);
  2625. id select_type table partitions type possible_keys key key_len ref rows Extra
  2626. 1 SIMPLE t1 p0_p0sp0,p0_p0sp1,pn_pnsp0,pn_pnsp1 ALL NULL NULL NULL NULL 5 Using where
  2627. explain partitions select * from t1 where (a IS NULL or a <= 1) AND (b=1 OR b=2);
  2628. id select_type table partitions type possible_keys key key_len ref rows Extra
  2629. 1 SIMPLE t1 p0_p0sp0,p0_p0sp1,pn_pnsp0,pn_pnsp1 ALL NULL NULL NULL NULL 5 Using where
  2630. drop table t1;
  2631. create table t1 ( a int) partition by list (MOD(a, 10))
  2632. ( partition p0 values in (0), partition p1 values in (1),
  2633. partition p2 values in (2), partition p3 values in (3),
  2634. partition p4 values in (4), partition p5 values in (5),
  2635. partition p6 values in (6), partition pn values in (NULL)
  2636. );
  2637. insert into t1 values (NULL), (0),(1),(2),(3),(4),(5),(6);
  2638. explain partitions select * from t1 where a is null or a < 2;
  2639. id select_type table partitions type possible_keys key key_len ref rows Extra
  2640. 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,pn ALL NULL NULL NULL NULL 8 Using where
  2641. drop table t1;
  2642. create table t1 (s1 int) partition by list (s1)
  2643. (partition p1 values in (0),
  2644. partition p2 values in (1),
  2645. partition p3 values in (null));
  2646. insert into t1 values (0),(1),(null);
  2647. select count(*) from t1 where s1 < 0 or s1 is null;
  2648. count(*)
  2649. 1
  2650. explain partitions select count(*) from t1 where s1 < 0 or s1 is null;
  2651. id select_type table partitions type possible_keys key key_len ref rows Extra
  2652. 1 SIMPLE t1 p3 system NULL NULL NULL NULL 1
  2653. drop table t1;
  2654. create table t1 (a char(32) primary key)
  2655. partition by key()
  2656. partitions 100;
  2657. insert into t1 values ('na');
  2658. select * from t1;
  2659. a
  2660. na
  2661. select * from t1 where a like 'n%';
  2662. a
  2663. na
  2664. drop table t1;
  2665. create table t1 (s1 varchar(15)) partition by key (s1);
  2666. select * from t1 where s1 = 0 or s1 is null;
  2667. s1
  2668. insert into t1 values ('aa'),('bb'),('0');
  2669. explain partitions select * from t1 where s1 = 0 or s1 is null;
  2670. id select_type table partitions type possible_keys key key_len ref rows Extra
  2671. 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where
  2672. drop table t1;
  2673. create table t2 (a int, b int)
  2674. partition by LIST(a)
  2675. subpartition by HASH(b) subpartitions 40
  2676. ( partition p_0_long_partition_name values in(1),
  2677. partition p_1_long_partition_name values in(2));
  2678. insert into t2 values (1,1),(2,2);
  2679. explain partitions select * from t2;
  2680. id 1
  2681. select_type SIMPLE
  2682. table t2
  2683. partitions p_0_long_partition_name_p_0_long_partition_namesp0,p_0_long_partition_name_p_0_long_partition_namesp1,p_0_long_partition_name_p_0_long_partition_namesp2,p_0_long_partition_name_p_0_long_partition_namesp3,p_0_long_partition_name_p_0_long_partition_namesp4,p_0_long_partition_name_p_0_long_partition_namesp5,p_0_long_partition_name_p_0_long_partition_namesp6,p_0_long_partition_name_p_0_long_partition_namesp7,p_0_long_partition_name_p_0_long_partition_namesp8,p_0_long_partition_name_p_0_long_partition_namesp9,p_0_long_partition_name_p_0_long_partition_namesp10,p_0_long_partition_name_p_0_long_partition_namesp11,p_0_long_partition_name_p_0_long_partition_namesp12,p_0_long_partition_name_p_0_long_partition_namesp13,p_0_long_partition_name_p_0_long_partition_namesp14,p_0_long_partition_name_p_0_long_partition_namesp15,p_0_long_partition_name_p_0_long_partition_namesp16,p_0_long_partition_name_p_0_long_partition_namesp17,p_0_long_partition_name_p_0_long_partition_namesp18,p_0_long_partition_name_p_0_long_partition_namesp19,p_0_long_partition_name_p_0_long_partition_namesp20,p_0_long_partition_name_p_0_long_partition_namesp21,p_0_long_partition_name_p_0_long_partition_namesp22,p_0_long_partition_name_p_0_long_partition_namesp23,p_0_long_partition_name_p_0_long_partition_namesp24,p_0_long_partition_name_p_0_long_partition_namesp25,p_0_long_partition_name_p_0_long_partition_namesp26,p_0_long_partition_name_p_0_long_partition_namesp27,p_0_long_partition_name_p_0_long_partition_namesp28,p_0_long_partition_name_p_0_long_partition_namesp29,p_0_long_partition_name_p_0_long_partition_namesp30,p_0_long_partition_name_p_0_long_partition_namesp31,p_0_long_partition_name_p_0_long_partition_namesp32,p_0_long_partition_name_p_0_long_partition_namesp33,p_0_long_partition_name_p_0_long_partition_namesp34,p_0_long_partition_name_p_0_long_partition_namesp35,p_0_long_partition_name_p_0_long_partition_namesp36,p_0_long_partition_name_p_0_long_partition_namesp37,p_0_long_partition_name_p_0_long_partition_namesp38,p_0_long_partition_name_p_0_long_partition_namesp39,p_1_long_partition_name_p_1_long_partition_namesp0,p_1_long_partition_name_p_1_long_partition_namesp1,p_1_long_partition_name_p_1_long_partition_namesp2,p_1_long_partition_name_p_1_long_partition_namesp3,p_1_long_partition_name_p_1_long_partition_namesp4,p_1_long_partition_name_p_1_long_partition_namesp5,p_1_long_partition_name_p_1_long_partition_namesp6,p_1_long_partition_name_p_1_long_partition_namesp7,p_1_long_partition_name_p_1_long_partition_namesp8,p_1_long_partition_name_p_1_long_partition_namesp9,p_1_long_partition_name_p_1_long_partition_namesp10,p_1_long_partition_name_p_1_long_partition_namesp11,p_1_long_partition_name_p_1_long_partition_namesp12,p_1_long_partition_name_p_1_long_partition_namesp13,p_1_long_partition_name_p_1_long_partition_namesp14,p_1_long_partition_name_p_1_long_partition_namesp15,p_1_long_partition_name_p_1_long_partition_namesp16,p_1_long_partition_name_p_1_long_partition_namesp17,p_1_long_partition_name_p_1_long_partition_namesp18,p_1_long_partition_name_p_1_long_partition_namesp19,p_1_long_partition_name_p_1_long_partition_namesp20,p_1_long_partition_name_p_1_long_partition_namesp21,p_1_long_partition_name_p_1_long_partition_namesp22,p_1_long_partition_name_p_1_long_partition_namesp23,p_1_long_partition_name_p_1_long_partition_namesp24,p_1_long_partition_name_p_1_long_partition_namesp25,p_1_long_partition_name_p_1_long_partition_namesp26,p_1_long_partition_name_p_1_long_partition_namesp27,p_1_long_partition_name_p_1_long_partition_namesp28,p_1_long_partition_name_p_1_long_partition_namesp29,p_1_long_partition_name_p_1_long_partition_namesp30,p_1_long_partition_name_p_1_long_partition_namesp31,p_1_long_partition_name_p_1_long_partition_namesp32,p_1_long_partition_name_p_1_long_partition_namesp33,p_1_long_partition_name_p_1_long_partition_namesp34,p_1_long_partition_name_p_1_long_partition_namesp35,p_1_long_partition_name_p_1_long_partition_namesp36,p_1_long_partition_name_p_1_long_partition_namesp37,p_1_long_partition_name_p_1_long_partition_names
  2684. type ALL
  2685. possible_keys NULL
  2686. key NULL
  2687. key_len NULL
  2688. ref NULL
  2689. rows 2
  2690. Extra
  2691. drop table t2;
  2692. create table t1 (s1 int);
  2693. explain partitions select 1 from t1 union all select 2;
  2694. id select_type table partitions type possible_keys key key_len ref rows Extra
  2695. 1 PRIMARY t1 NULL system NULL NULL NULL NULL 0 const row not found
  2696. 2 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
  2697. NULL UNION RESULT <union1,2> NULL ALL NULL NULL NULL NULL NULL
  2698. drop table t1;
  2699. create table t1 (a bigint unsigned not null) partition by range(a) (
  2700. partition p0 values less than (10),
  2701. partition p1 values less than (100),
  2702. partition p2 values less than (1000),
  2703. partition p3 values less than (18446744073709551000),
  2704. partition p4 values less than (18446744073709551614)
  2705. );
  2706. insert into t1 values (5),(15),(105),(1005);
  2707. insert into t1 values (18446744073709551000+1);
  2708. insert into t1 values (18446744073709551614-1);
  2709. explain partitions select * from t1 where a < 10;
  2710. id select_type table partitions type possible_keys key key_len ref rows Extra
  2711. 1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
  2712. explain partitions select * from t1
  2713. where a >= 18446744073709551000-1 and a <= 18446744073709551000+1;
  2714. id select_type table partitions type possible_keys key key_len ref rows Extra
  2715. 1 SIMPLE t1 p3,p4 ALL NULL NULL NULL NULL 4 Using where
  2716. explain partitions select * from t1
  2717. where a between 18446744073709551001 and 18446744073709551002;
  2718. id select_type table partitions type possible_keys key key_len ref rows Extra
  2719. 1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where
  2720. explain partitions select * from t1 where a = 18446744073709551000;
  2721. id select_type table partitions type possible_keys key key_len ref rows Extra
  2722. 1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where
  2723. explain partitions select * from t1 where a = 18446744073709551613;
  2724. id select_type table partitions type possible_keys key key_len ref rows Extra
  2725. 1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where
  2726. explain partitions select * from t1 where a = 18446744073709551614;
  2727. id select_type table partitions type possible_keys key key_len ref rows Extra
  2728. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2729. drop table t1;
  2730. create table t1 (a int)
  2731. partition by range(a) (
  2732. partition p0 values less than (64),
  2733. partition p1 values less than (128),
  2734. partition p2 values less than (255)
  2735. );
  2736. create table t2 (a int)
  2737. partition by range(a+0) (
  2738. partition p0 values less than (64),
  2739. partition p1 values less than (128),
  2740. partition p2 values less than (255)
  2741. );
  2742. insert into t1 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE);
  2743. insert into t2 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE);
  2744. explain partitions select * from t1 where a=0;
  2745. id select_type table partitions type possible_keys key key_len ref rows Extra
  2746. 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
  2747. explain partitions select * from t2 where a=0;
  2748. id select_type table partitions type possible_keys key key_len ref rows Extra
  2749. 1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 2 Using where
  2750. explain partitions select * from t1 where a=0xFE;
  2751. id select_type table partitions type possible_keys key key_len ref rows Extra
  2752. 1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 4 Using where
  2753. explain partitions select * from t2 where a=0xFE;
  2754. id select_type table partitions type possible_keys key key_len ref rows Extra
  2755. 1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 4 Using where
  2756. explain partitions select * from t1 where a > 0xFE AND a <= 0xFF;
  2757. id select_type table partitions type possible_keys key key_len ref rows Extra
  2758. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2759. explain partitions select * from t2 where a > 0xFE AND a <= 0xFF;
  2760. id select_type table partitions type possible_keys key key_len ref rows Extra
  2761. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2762. explain partitions select * from t1 where a >= 0xFE AND a <= 0xFF;
  2763. id select_type table partitions type possible_keys key key_len ref rows Extra
  2764. 1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 4 Using where
  2765. explain partitions select * from t2 where a >= 0xFE AND a <= 0xFF;
  2766. id select_type table partitions type possible_keys key key_len ref rows Extra
  2767. 1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 4 Using where
  2768. explain partitions select * from t1 where a < 64 AND a >= 63;
  2769. id select_type table partitions type possible_keys key key_len ref rows Extra
  2770. 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where
  2771. explain partitions select * from t2 where a < 64 AND a >= 63;
  2772. id select_type table partitions type possible_keys key key_len ref rows Extra
  2773. 1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 4 Using where
  2774. explain partitions select * from t1 where a <= 64 AND a >= 63;
  2775. id select_type table partitions type possible_keys key key_len ref rows Extra
  2776. 1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 6 Using where
  2777. explain partitions select * from t2 where a <= 64 AND a >= 63;
  2778. id select_type table partitions type possible_keys key key_len ref rows Extra
  2779. 1 SIMPLE t2 p0,p1 ALL NULL NULL NULL NULL 6 Using where
  2780. drop table t1;
  2781. drop table t2;
  2782. create table t1(a bigint unsigned not null) partition by range(a+0) (
  2783. partition p1 values less than (10),
  2784. partition p2 values less than (20),
  2785. partition p3 values less than (2305561538531885056),
  2786. partition p4 values less than (2305561538531950591)
  2787. );
  2788. insert into t1 values (9),(19),(0xFFFF0000FFFF000-1), (0xFFFF0000FFFFFFF-1);
  2789. insert into t1 values (9),(19),(0xFFFF0000FFFF000-1), (0xFFFF0000FFFFFFF-1);
  2790. explain partitions select * from t1 where
  2791. a >= 2305561538531885056-10 and a <= 2305561538531885056-8;
  2792. id select_type table partitions type possible_keys key key_len ref rows Extra
  2793. 1 SIMPLE t1 p3 ALL NULL NULL NULL NULL 4 Using where
  2794. explain partitions select * from t1 where
  2795. a > 0xFFFFFFFFFFFFFFEC and a < 0xFFFFFFFFFFFFFFEE;
  2796. id select_type table partitions type possible_keys key key_len ref rows Extra
  2797. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
  2798. explain partitions select * from t1 where a>=0 and a <= 0xFFFFFFFFFFFFFFFF;
  2799. id select_type table partitions type possible_keys key key_len ref rows Extra
  2800. 1 SIMPLE t1 p1,p2,p3,p4 ALL NULL NULL NULL NULL 8 Using where
  2801. drop table t1;
  2802. create table t1 (a bigint) partition by range(a+0) (
  2803. partition p1 values less than (-1000),
  2804. partition p2 values less than (-10),
  2805. partition p3 values less than (10),
  2806. partition p4 values less than (1000)
  2807. );
  2808. insert into t1 values (-15),(-5),(5),(15),(-15),(-5),(5),(15);
  2809. explain partitions select * from t1 where a>-2 and a <=0;
  2810. id select_type table partitions type possible_keys key key_len ref rows Extra
  2811. 1 SIMPLE t1 p3 ALL NULL NULL NULL NULL 4 Using where
  2812. drop table t1;
  2813. CREATE TABLE t1 ( recdate DATETIME NOT NULL )
  2814. PARTITION BY RANGE( TO_DAYS(recdate) ) (
  2815. PARTITION p0 VALUES LESS THAN ( TO_DAYS('2007-03-08') ),
  2816. PARTITION p1 VALUES LESS THAN ( TO_DAYS('2007-04-01') )
  2817. );
  2818. INSERT INTO t1 VALUES ('2007-03-01 12:00:00');
  2819. INSERT INTO t1 VALUES ('2007-03-07 12:00:00');
  2820. INSERT INTO t1 VALUES ('2007-03-08 12:00:00');
  2821. INSERT INTO t1 VALUES ('2007-03-15 12:00:00');
  2822. must use p0 only:
  2823. explain partitions select * from t1 where recdate < '2007-03-08 00:00:00';
  2824. id select_type table partitions type possible_keys key key_len ref rows Extra
  2825. 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
  2826. drop table t1;
  2827. CREATE TABLE t1 ( recdate DATETIME NOT NULL )
  2828. PARTITION BY RANGE( YEAR(recdate) ) (
  2829. PARTITION p0 VALUES LESS THAN (2006),
  2830. PARTITION p1 VALUES LESS THAN (2007)
  2831. );
  2832. INSERT INTO t1 VALUES ('2005-03-01 12:00:00');
  2833. INSERT INTO t1 VALUES ('2005-03-01 12:00:00');
  2834. INSERT INTO t1 VALUES ('2006-03-01 12:00:00');
  2835. INSERT INTO t1 VALUES ('2006-03-01 12:00:00');
  2836. must use p0 only:
  2837. explain partitions select * from t1 where recdate < '2006-01-01 00:00:00';
  2838. id select_type table partitions type possible_keys key key_len ref rows Extra
  2839. 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
  2840. drop table t1;