pgsql: Prevent growth of simplehash tables when they're "too empty".

Поиск
Список
Период
Сортировка
От Andres Freund
Тема pgsql: Prevent growth of simplehash tables when they're "too empty".
Дата
Msg-id E1egF44-0004s2-CC@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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
d4c62a6b623d6eef88218158e9fa3cf974c6c7e5 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

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d1aac2998789e16343befd8b3de8ad12b6dc4355

Modified Files
--------------
src/include/lib/simplehash.h | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: pgsql: Improve bit perturbation in TupleHashTableHash.
Следующее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: doc: Clarify pg_upgrade documentation