postgresql/src/include
Andres Freund ab9f2c429d Prevent growth of simplehash tables when they're "too empty".
In cases where simplehash tables where filled with either a lot of
conflicting hash-values, or values that hash to consecutive
values (i.e. build "chains") the growth heuristics in
d4c62a6b62 could trigger rather
explosively.

To fix that, address some of the reasons (see previous commit) of why
the growth heuristics where needed, and only allow growth when the
table isn't too empty. While that means there's a few cases of bad
input that can be slower, that seems a lot better than running very
quickly out of memory.

Author: Tomas Vondra and Andres Freund, with additional input by
    Thomas Munro, Tom Lane Todd A. Cook
Reported-By: Todd A. Cook, Tomas Vondra, Thomas Munro
Discussion: https://postgr.es/m/20171127185700.1470.20362@wrigleys.postgresql.org
Backpatch: 10, where simplehash was introduced
2018-01-29 11:24:57 -08:00
..
access Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers. 2018-01-26 18:25:14 -05:00
bootstrap Update copyright for 2018 2018-01-02 23:30:12 -05:00
catalog Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
commands Transaction control in PL procedures 2018-01-22 08:43:06 -05:00
common Implement channel binding tls-server-end-point for SCRAM 2018-01-04 15:29:50 -05:00
datatype Update copyright for 2018 2018-01-02 23:30:12 -05:00
executor Avoid referencing off the end of subplan_partition_offsets. 2018-01-24 16:34:51 -05:00
fe_utils Update copyright for 2018 2018-01-02 23:30:12 -05:00
foreign Update copyright for 2018 2018-01-02 23:30:12 -05:00
lib Prevent growth of simplehash tables when they're "too empty". 2018-01-29 11:24:57 -08:00
libpq Use abstracted SSL API in server connection log messages 2018-01-26 09:50:46 -05:00
mb 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 Allow UPDATE to move rows between partitions. 2018-01-19 15:33:06 -05:00
parser Local partitioned indexes 2018-01-19 11:49:22 -03:00
port Remove outdated/removed Win32 URLs in C comments 2018-01-09 18:33:21 -05:00
portability Update copyright for 2018 2018-01-02 23:30:12 -05:00
postmaster Update copyright for 2018 2018-01-02 23:30:12 -05:00
regex Update copyright for 2018 2018-01-02 23:30:12 -05:00
replication Ability to advance replication slots 2018-01-17 11:38:34 +00:00
rewrite Update copyright for 2018 2018-01-02 23:30:12 -05:00
snowball Update copyright for 2018 2018-01-02 23:30:12 -05:00
statistics Update copyright for 2018 2018-01-02 23:30:12 -05:00
storage Allow ConditionVariable[PrepareTo]Sleep to auto-switch between CVs. 2018-01-09 11:39:10 -05:00
tcop Replace GrantObjectType with ObjectType 2018-01-19 14:01:14 -05:00
tsearch Update copyright for 2018 2018-01-02 23:30:12 -05:00
utils Split out documentation of SSL parameters into their own section 2018-01-23 07:11:38 -05:00
.gitignore Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
c.h Improve implementation of pg_attribute_always_inline. 2018-01-23 23:07:13 -05:00
fmgr.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
funcapi.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
getaddrinfo.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
getopt_long.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
Makefile Add statistics subdirectory to Makefile. 2017-06-08 11:29:50 -04:00
miscadmin.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pg_config.h.in Another attempt at fixing build with various OpenSSL versions 2018-01-04 19:09:27 -05:00
pg_config.h.win32 Provide overflow safe integer math inline functions. 2017-12-12 16:55:37 -08:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pg_getopt.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pg_trace.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pgstat.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pgtar.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pgtime.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
port.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
postgres.h Remove byte-masking macros for Datum conversion macros 2018-01-26 08:46:27 -05:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
rusagestub.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
windowapi.h Update copyright for 2018 2018-01-02 23:30:12 -05:00