postgresql/src
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
..
backend Refactor code for partition bound searching 2018-02-02 09:32:44 -05:00
bin psql: Add quit/help behavior/hint, for other tool portability 2018-02-01 08:30:43 -05:00
common Update copyright for 2018 2018-01-02 23:30:12 -05:00
fe_utils Update copyright for 2018 2018-01-02 23:30:12 -05:00
include Add new function WaitForParallelWorkersToAttach. 2018-02-02 09:00:59 -05:00
interfaces Refactor client-side SSL certificate checking code 2018-01-30 22:56:24 -05:00
makefiles Always use -fPIC, not -fpic, when building shared libraries with gcc. 2017-06-01 13:32:55 -04:00
pl PL/Python: Fix tests for older Python versions 2018-01-22 12:09:52 -05:00
port Update copyright for 2018 2018-01-02 23:30:12 -05:00
template Force "restrict" not to be used when compiling with xlc. 2017-10-13 12:15:06 -07:00
test Fix typo: colums -> columns. 2018-01-31 16:45:37 -05:00
timezone Update time zone data files to tzdata release 2018c. 2018-01-27 16:42:28 -05:00
tools Refactor client-side SSL certificate checking code 2018-01-30 22:56:24 -05:00
tutorial Update copyright for 2018 2018-01-02 23:30:12 -05:00
.gitignore
DEVELOPERS
Makefile Build src/test/isolation during "make" and "make install". 2017-11-22 20:18:15 -08:00
Makefile.global.in Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
Makefile.shlib Remove support for bcc and msvc standalone libpq builds 2017-04-11 15:22:21 +02:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00