diff options
author | unknown <patg@govinda.patg.net> | 2006-01-28 16:22:32 -0800 |
---|---|---|
committer | unknown <patg@govinda.patg.net> | 2006-01-28 16:22:32 -0800 |
commit | ff5d012454023c4f89edd16659d470eb0db7a763 (patch) | |
tree | fe8077020fa0067a351ca1942c648c78d82ec3da /sql/sql_partition.cc | |
parent | 9f59664b3666332f5bf91022cb365d07706f9029 (diff) | |
download | mariadb-git-ff5d012454023c4f89edd16659d470eb0db7a763.tar.gz |
WL# 2986
Final patch
-----------
This WL is about using this bitmap in all parts of the partition handler.
Thus for:
rnd_init/rnd_next
index_init/index_next and all other variants of index scans
read_range_... the various range scans implemented in the partition handler.
Also use those bitmaps in the various other calls that currently loop over all
partitions.
mysql-test/r/partition_pruning.result:
WL# 2986
New results reflecting bitmap being used to determine if a partition is to be
included
mysql-test/t/partition_pruning.test:
WL# 2986
New tests to show bitmap being used in ha_partition
sql/ha_partition.cc:
WL# 2986
Used work from 2682 and removed the partition select code.
Added do {} while loop to any iteration over partitions to now utilise
m_part_info->used_partitions bitmap to determine if a partition should be
used.
sql/ha_partition.h:
WL# 2986
Removed unused member
sql/handler.h:
WL# 2986
Removed unused member
sql/opt_range.cc:
WL# 2986
Added bitmap_clear_all to clear bitmap prior to pruning
DBUG code for testing
sql/sql_partition.cc:
WL# 2986
Changed < to <=, which fixes the problem with edge cases going awry.
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r-- | sql/sql_partition.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 52d2d61e843..c29f5ef5650 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -3004,7 +3004,7 @@ int get_partition_id_range(partition_info *part_info, while (max_part_id > min_part_id) { loc_part_id= (max_part_id + min_part_id + 1) >> 1; - if (range_array[loc_part_id] < part_func_value) + if (range_array[loc_part_id] <= part_func_value) min_part_id= loc_part_id + 1; else max_part_id= loc_part_id - 1; @@ -3077,7 +3077,7 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info, while (max_part_id > min_part_id) { loc_part_id= (max_part_id + min_part_id + 1) >> 1; - if (range_array[loc_part_id] < part_func_value) + if (range_array[loc_part_id] <= part_func_value) min_part_id= loc_part_id + 1; else max_part_id= loc_part_id - 1; @@ -3639,7 +3639,6 @@ void get_partition_set(const TABLE *table, byte *buf, const uint index, bool found_part_field= FALSE; DBUG_ENTER("get_partition_set"); - part_spec->use_bit_array= FALSE; part_spec->start_part= 0; part_spec->end_part= no_parts - 1; if ((index < MAX_KEY) && @@ -3757,7 +3756,6 @@ void get_partition_set(const TABLE *table, byte *buf, const uint index, else { DBUG_ASSERT(sub_part != no_parts); - part_spec->use_bit_array= TRUE; part_spec->start_part= sub_part; part_spec->end_part=sub_part+ (part_info->no_subparts*(part_info->no_parts-1)); |