summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorRobert Haas2018-02-02 14:23:42 +0000
committerRobert Haas2018-02-02 14:32:44 +0000
commit9aef173163ae68c6b241e4c9bbb375c6baa71c60 (patch)
tree37ec150db1732ca44087e8ff883b81a94a0772ba /contrib
parent9222c0d9ed9794d54fc3f5101498829eaec9e799 (diff)
Refactor code for partition bound searching
Remove partition_bound_cmp() and partition_bound_bsearch(), whose void * argument could be, depending on the situation, of any of three different types: PartitionBoundSpec *, PartitionRangeBound *, Datum *. Instead, introduce separate bound-searching functions for each situation: partition_list_bsearch, partition_range_bsearch, partition_range_datum_bsearch, and partition_hash_bsearch. This requires duplicating the code for binary search, but it makes the code much more type safe, involves fewer branches at runtime, and at least in my opinion, is much easier to understand. Along the way, add an option to partition_range_datum_bsearch allowing the number of keys to be specified, so that we can search for partitions based on a prefix of the full list of partition keys. This is important for pending work to improve partition pruning. Amit Langote, per a suggestion from me. Discussion: http://postgr.es/m/CA+TgmoaVLDLc8=YESRwD32gPhodU_ELmXyKs77gveiYp+JE4vQ@mail.gmail.com
Diffstat (limited to 'contrib')
0 files changed, 0 insertions, 0 deletions