Re: Whether to back-patch fix for aggregate transtype width estimates

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Whether to back-patch fix for aggregate transtype width estimates
Дата
Msg-id CAM-w4HPchTTZS6+Z-WOi_THNhdR=H4YNYuZgRrAi3BEDTorPCw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Whether to back-patch fix for aggregate transtype width estimates  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sat, Jun 18, 2016 at 5:14 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> .  In 9.x, that's broken and it falls back to
> get_typavgwidth's default guess of 32 bytes.  If what you've actually
> got is, say, varchar(255) and most of the entries actually approach
> that length, this could result in a drastic underestimate, possibly
> leading to OOM from hash table growth.


This seems more likely to result in the converse. 32 bytes is enough
distinct values I imagine it's going to avoid a hash join. (and In any
case if you have a varchar(n) where n>32 then it's probably a bad bet
to assume n gives much information about the typical length of the
strings). On the other hand if what you've actually got is a
varchar(1) or something like that then indeed a hash join might have
been a good choice.

-- 
greg



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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: 10.0
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: parallel.c is not marked as test covered