Re: Trouble with hashagg spill I/O pattern and costing

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: Trouble with hashagg spill I/O pattern and costing
Дата
Msg-id 20200521183405.gq5oaarqs5gtqugt@development
обсуждение исходный текст
Ответ на Re: Trouble with hashagg spill I/O pattern and costing  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: Trouble with hashagg spill I/O pattern and costing  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Список pgsql-hackers
On Thu, May 21, 2020 at 11:19:01AM -0700, Jeff Davis wrote:
>On Thu, 2020-05-21 at 16:30 +0200, Tomas Vondra wrote:
>> OK, it seems the attached trivial fix (simply changing CP_LABEL_TLIST
>> to
>> CP_SMALL_TLIST) addresses this for me.
>
>Great!
>
>There were a couple plan changes where it introduced a Subquery Scan.
>I'm not sure that I understand why it's doing that, can you verify that
>it is a reasonable thing to do?
>
>Aside from that, feel free to commit it.
>

It's doing that because we're doing projection everywhere, even in cases
when it may not be necessary - but I think that's actually OK.

At first I thought we might only do it conditionally when we expect to
spill to disk, but that'd not work for cases when we only realize we
need to spill to disk during execution.

So I think the plan changes are correct and expected.

I think we should do the pre-allocation patch too. I haven't tried yet
but I believe the tlist fix alone won't do nearly as good.


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: Trouble with hashagg spill I/O pattern and costing
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Trouble with hashagg spill I/O pattern and costing