mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
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 ..."
This commit is contained in:
@@ -534,19 +534,52 @@ public:
|
||||
|
||||
List<char> part_field_list;
|
||||
List<char> subpart_field_list;
|
||||
|
||||
|
||||
/*
|
||||
If there is no subpartitioning, use only this func to get partition ids.
|
||||
If there is subpartitioning, use the this func to get partition id when
|
||||
you have both partition and subpartition fields.
|
||||
*/
|
||||
get_part_id_func get_partition_id;
|
||||
get_part_id_func get_part_partition_id;
|
||||
get_subpart_id_func get_subpartition_id;
|
||||
|
||||
/* Get partition id when we don't have subpartition fields */
|
||||
get_part_id_func get_part_partition_id;
|
||||
|
||||
/*
|
||||
Get subpartition id when we have don't have partition fields by we do
|
||||
have subpartition ids.
|
||||
Mikael said that for given constant tuple
|
||||
{subpart_field1, ..., subpart_fieldN} the subpartition id will be the
|
||||
same in all subpartitions
|
||||
*/
|
||||
get_subpart_id_func get_subpartition_id;
|
||||
|
||||
/* NULL-terminated list of fields used in partitioned expression */
|
||||
Field **part_field_array;
|
||||
/* NULL-terminated list of fields used in subpartitioned expression */
|
||||
Field **subpart_field_array;
|
||||
|
||||
/*
|
||||
Array of all fields used in partition and subpartition expression,
|
||||
without duplicates, NULL-terminated.
|
||||
*/
|
||||
Field **full_part_field_array;
|
||||
|
||||
Item *part_expr;
|
||||
Item *subpart_expr;
|
||||
|
||||
Item *item_free_list;
|
||||
|
||||
/*
|
||||
A bitmap of partitions used by the current query.
|
||||
Usage pattern:
|
||||
* It is guaranteed that all partitions are set to be unused on query start.
|
||||
* Before index/rnd_init(), partition pruning code sets the bits for used
|
||||
partitions.
|
||||
* The handler->extra(HA_EXTRA_RESET) call at query end sets all partitions
|
||||
to be unused.
|
||||
*/
|
||||
MY_BITMAP used_partitions;
|
||||
|
||||
union {
|
||||
longlong *range_int_array;
|
||||
@@ -747,6 +780,13 @@ void get_full_part_id_from_key(const TABLE *table, byte *buf,
|
||||
bool mysql_unpack_partition(THD *thd, const uchar *part_buf,
|
||||
uint part_info_len, TABLE *table,
|
||||
enum db_type default_db_type);
|
||||
void make_used_partitions_str(partition_info *part_info, String *parts_str);
|
||||
uint32 get_list_array_idx_for_endpoint(partition_info *part_info,
|
||||
bool left_endpoint,
|
||||
bool include_endpoint);
|
||||
uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
|
||||
bool left_endpoint,
|
||||
bool include_endpoint);
|
||||
#endif
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user