Re: Explain buffers wrong counter with parallel plans

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: Explain buffers wrong counter with parallel plans
Дата
Msg-id CAA4eK1L0KAZWgnRJz=VNVpyS3FFbVh8E5egyziaR0E10bC204Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Explain buffers wrong counter with parallel plans  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Explain buffers wrong counter with parallel plans
Список pgsql-hackers
On Sat, Jul 7, 2018 at 12:44 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Fri, Jul 6, 2018 at 9:44 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
>> I have tried this idea, but it doesn't completely solve the problem.
>> The problem is that nodes below LIMIT won't get a chance to accumulate
>> the stats as they won't be able to call InstrStopNode.
>
> I'm not sure I understand.  Why not?  I see that we'd need to insert
> an extra call to InstrStopNode() if we were stopping the node while it
> was running, because then InstrStartNode() would have already been
> done, but the corresponding call to InstrStopNode() would not have
> been done.  But I'm not sure how that would happen in this case.  Can
> you explain further?
>

Okay, let me try.   The code flow is that for each node we will call
InstrStartNode()->ExecProcNodeReal()->InstrStopNode().  Now let's say
we have to execute a plan Limit->Gather-> Parallel SeqScan.  In this,
first for Limit node, we will call InstrStartNode() and
ExecProcNodeReal() and then for Gather we will call InstrStartNode(),
ExecProcNodeReal() and InstrStopNode().  Now, Limit node decides that
it needs to shutdown all the nodes (ExecShutdownNode) and after that
it will call InstrStopNode() for Limit node.  So, in this flow after
shutting down nodes, we never get chance for Gather node to use stats
collected during ExecShutdownNode.

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com


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

Предыдущее
От: Larry Rosenman
Дата:
Сообщение: Re: peripatus build failures....
Следующее
От: Brent Kerby
Дата:
Сообщение: Transition relations: correlating OLD TABLE and NEW TABLE