postgresql/src/backend
Andres Freund 317ffdfeaa Allow to reset execGrouping.c style tuple hashtables.
This has the advantage that the comparator expression, the table's
slot, etc do not have to be rebuilt. Additionally the simplehash.h
hashtable within the tuple hashtable now keeps its previous size and
doesn't need to be reallocated. That both reduces allocator overhead,
and improves performance in cases where the input estimation was off
by a significant factor.

To avoid an API/ABI break, the new parameter is exposed via the new
BuildTupleHashTableExt(), and BuildTupleHashTable() now is a wrapper
around the former, that continues to allocate the table itself in the
tablecxt.

Using this fixes performance issues discovered in the two bugs
referenced. This commit however has not converted the callers, that's
done in a separate commit.

Bug: #15592 #15486
Reported-By: Jakub Janeček, Dmitry Marakasov
Author: Andres Freund
Discussion:
    https://postgr.es/m/15486-05850f065da42931@postgresql.org
    https://postgr.es/m/20190114180423.ywhdg2iagzvh43we@alap3.anarazel.de
Backpatch: 11, this is a prerequisite for other fixes
2019-02-09 01:05:49 -08:00
..
access Fix heap_getattr() handling of fast defaults. 2019-02-06 01:09:32 -08:00
bootstrap Remove argument isprimary from index_build() 2019-01-24 07:57:09 +09:00
catalog Use EXECUTE FUNCTION syntax for triggers more 2019-02-07 09:21:34 +01:00
commands Fix heap_getattr() handling of fast defaults. 2019-02-06 01:09:32 -08:00
executor Allow to reset execGrouping.c style tuple hashtables. 2019-02-09 01:05:49 -08:00
foreign Update copyright for 2019 2019-01-02 12:44:25 -05:00
jit Renaming for new subscripting mechanism 2019-02-01 12:50:32 -03:00
lib Update copyright for 2019 2019-01-02 12:44:25 -05:00
libpq Fix error handling around ssl_*_protocol_version settings 2019-02-08 11:58:19 +01:00
main Replace @postgresql.org with @lists.postgresql.org for mailinglists 2019-01-19 19:06:35 +01:00
nodes Renaming for new subscripting mechanism 2019-02-01 12:50:32 -03:00
optimizer Split create_foreignscan_path() into three functions. 2019-02-07 13:11:12 -05:00
parser Add collation assignment to CALL statement 2019-02-07 08:25:47 +01:00
partitioning Refactor planner's header files. 2019-01-29 15:48:51 -05:00
po Translation updates 2018-06-25 12:37:18 +02:00
port Add shared_memory_type GUC. 2019-02-03 12:47:26 +01:00
postmaster Add more columns to pg_stat_ssl 2019-02-01 00:33:47 +01:00
regex Update copyright for 2019 2019-01-02 12:44:25 -05:00
replication Refactor planner's header files. 2019-01-29 15:48:51 -05:00
rewrite Renaming for new subscripting mechanism 2019-02-01 12:50:32 -03:00
snowball Update copyright for 2019 2019-01-02 12:44:25 -05:00
statistics Rename nodes/relation.h to nodes/pathnodes.h. 2019-01-29 16:49:25 -05:00
storage Avoid creation of the free space map for small heap relations, take 2. 2019-02-04 07:49:15 +05:30
tcop Refactor planner's header files. 2019-01-29 15:48:51 -05:00
tsearch Update copyright for 2019 2019-01-02 12:44:25 -05:00
utils Defend against null error message reported by libxml2. 2019-02-08 13:30:42 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Ensure link commands list *.o files before LDFLAGS. 2019-01-02 13:57:54 -05:00
nls.mk Translation updates 2018-06-25 12:37:18 +02:00