postgresql/src/backend
Robert Haas 9aef173163 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
2018-02-02 09:32:44 -05:00
..
access Add new function WaitForParallelWorkersToAttach. 2018-02-02 09:00:59 -05:00
bootstrap Local partitioned indexes 2018-01-19 11:49:22 -03:00
catalog Refactor code for partition bound searching 2018-02-02 09:32:44 -05:00
commands Silence complaint about dead assignment 2018-01-29 20:43:43 -05:00
executor Add new function WaitForParallelWorkersToAttach. 2018-02-02 09:00:59 -05:00
foreign Update copyright for 2018 2018-01-02 23:30:12 -05:00
lib Update copyright for 2018 2018-01-02 23:30:12 -05:00
libpq Fix up references to scram-sha-256 2018-01-30 16:50:30 -05:00
main Update copyright for 2018 2018-01-02 23:30:12 -05:00
nodes Remove the obsolete WITH clause of CREATE FUNCTION. 2018-01-26 12:25:44 -05:00
optimizer Add stack-overflow guards in set-operation planning. 2018-01-28 13:39:07 -05:00
parser Fix typo: colums -> columns. 2018-01-31 16:45:37 -05:00
po Translation updates 2017-08-07 13:55:34 -04:00
port Support huge pages on Windows 2018-01-21 15:40:46 +01:00
postmaster Use abstracted SSL API in server connection log messages 2018-01-26 09:50:46 -05:00
regex Update copyright for 2018 2018-01-02 23:30:12 -05:00
replication Fix typo in recent commit 2018-01-19 06:36:17 +00:00
rewrite Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
snowball Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers. 2018-01-26 18:25:14 -05:00
statistics Update copyright for 2018 2018-01-02 23:30:12 -05:00
storage Fix Latin spelling 2018-01-11 08:32:01 -05:00
tcop Transaction control in PL procedures 2018-01-22 08:43:06 -05:00
tsearch Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers. 2018-01-26 18:25:14 -05:00
utils Add some noreturn attributes to help static analyzers 2018-01-29 20:44:35 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Update copyright for 2018 2018-01-02 23:30:12 -05:00
common.mk Add ICU_CFLAGS to global CPPFLAGS 2017-06-12 15:57:22 -04:00
nls.mk Translation updates 2017-05-15 12:19:54 -04:00