pgsql: Remove large fill factor support from dynahash.c.

From: Thomas Munro <tmunro(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove large fill factor support from dynahash.c.
Date: 2020-09-18 23:54:24
Message-ID: E1kJQCu-0000z4-DV@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Remove large fill factor support from dynahash.c.

Since ancient times we have had support for a fill factor (maximum load
factor) to be set for a dynahash hash table, but:

1. It was an integer, whereas for in-memory hash tables interesting
load factor targets are probably somewhere near the 0.75-1.0 range.

2. It was implemented in a way that performed an expensive division
operation that regularly showed up in profiles.

3. We are not aware of anyone ever having used a non-default value.

Therefore, remove support, effectively fixing it at 1.

Author: Jakub Wartak <Jakub(dot)Wartak(at)tomtom(dot)com>
Reviewed-by: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Reviewed-by: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Reviewed-by: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Reviewed-by: David Rowley <dgrowleyml(at)gmail(dot)com>
Discussion: https://postgr.es/m/VI1PR0701MB696044FC35013A96FECC7AC8F62D0%40VI1PR0701MB6960.eurprd07.prod.outlook.com

Branch
------
master

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

Modified Files
--------------
src/backend/utils/hash/dynahash.c | 20 ++++++--------------
src/include/utils/hsearch.h | 2 --
2 files changed, 6 insertions(+), 16 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2020-09-19 03:55:20 pgsql: Code review for dynahash change.
Previous Message Tom Lane 2020-09-18 22:04:06 pgsql: Use factorial rather than numeric_fac in create_operator.sql.