Re: EXPLAIN: Non-parallel ancestor plan nodes exclude parallel worker instrumentation

2020-06-25 Thread Maciek Sakrejda
On Wed, Jun 24, 2020 at 2:44 AM Amit Kapila wrote: > So, that leads to loops as 2 on "Parallel Seq Scan" and "Nested Loop" nodes. > Does this make sense now? Yes, I think we're on the same page. Thanks for the additional details. It turns out that the plan I sent at the top of the thread is ac

Re: EXPLAIN: Non-parallel ancestor plan nodes exclude parallel worker instrumentation

2020-06-24 Thread Amit Kapila
On Tue, Jun 23, 2020 at 12:55 AM Maciek Sakrejda wrote: > > Hello, > > I had some questions about the behavior of some accounting in parallel > EXPLAIN plans. Take the following plan: > > .. > > The Nested Loop here aggregates data for metrics like `buffers read` > from its workers, and to calcula

Re: EXPLAIN: Non-parallel ancestor plan nodes exclude parallel worker instrumentation

2020-06-24 Thread Amit Kapila
On Wed, Jun 24, 2020 at 12:41 PM Maciek Sakrejda wrote: > > On Tue, Jun 23, 2020 at 7:55 PM Amit Kapila wrote: > > > I don't see any other reason for > > > looping over the NL node itself in this plan. The Gather itself > > > doesn't do any real looping, right? > > > > It is right that Gather doe

Re: EXPLAIN: Non-parallel ancestor plan nodes exclude parallel worker instrumentation

2020-06-24 Thread Maciek Sakrejda
On Tue, Jun 23, 2020 at 7:55 PM Amit Kapila wrote: > > I don't see any other reason for > > looping over the NL node itself in this plan. The Gather itself > > doesn't do any real looping, right? > > It is right that Gather doesn't do looping but Parallel Seq Scan node does so. Sorry, I still don

Re: EXPLAIN: Non-parallel ancestor plan nodes exclude parallel worker instrumentation

2020-06-23 Thread Amit Kapila
On Wed, Jun 24, 2020 at 3:18 AM Maciek Sakrejda wrote: > > On Tue, Jun 23, 2020 at 2:57 AM Amit Kapila wrote: > > I don't think this is an odd situation because in this case, child > > nodes like "Nested Loop" and "Parallel Seq Scan" has a value of > > 'loops' as 3. So, to get the correct stats

Re: EXPLAIN: Non-parallel ancestor plan nodes exclude parallel worker instrumentation

2020-06-23 Thread Maciek Sakrejda
On Tue, Jun 23, 2020 at 2:57 AM Amit Kapila wrote: > I don't think this is an odd situation because in this case, child > nodes like "Nested Loop" and "Parallel Seq Scan" has a value of > 'loops' as 3. So, to get the correct stats at those nodes, you need > to divide it by 3 whereas, at Gather no

Re: EXPLAIN: Non-parallel ancestor plan nodes exclude parallel worker instrumentation

2020-06-23 Thread Amit Kapila
On Tue, Jun 23, 2020 at 12:55 AM Maciek Sakrejda wrote: > > Hello, > > I had some questions about the behavior of some accounting in parallel > EXPLAIN plans. Take the following plan: > > ``` > Gather (cost=1000.43..750173.74 rows=2 width=235) (actual > time=1665.122..1665.122 rows=0 loops=1) >