pgsql: Fix hash table size estimation error in choose_hashed_distinct()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix hash table size estimation error in choose_hashed_distinct()
Дата
Msg-id E1VCCMp-0004Od-3P@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix hash table size estimation error in choose_hashed_distinct().

We should account for the per-group hashtable entry overhead when
considering whether to use a hash aggregate to implement DISTINCT.  The
comparable logic in choose_hashed_grouping() gets this right, but I think
I omitted it here in the mistaken belief that there would be no overhead
if there were no aggregate functions to be evaluated.  This can result in
more than 2X underestimate of the hash table size, if the tuples being
aggregated aren't very wide.  Per report from Tomas Vondra.

This bug is of long standing, but per discussion we'll only back-patch into
9.3.  Changing the estimation behavior in stable branches seems to carry too
much risk of destabilizing plan choices for already-tuned applications.

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/e6d3f5b35edad5452936bf4842167fa00c8b64b8

Modified Files
--------------
src/backend/optimizer/plan/planner.c |    4 ++++
1 file changed, 4 insertions(+)


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: pgsql: docs: Remove second 'trim' index reference
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix hash table size estimation error in choose_hashed_distinct()