Re: Actuall row count of Parallel Seq Scan in EXPLAIN ANALYZE .

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Actuall row count of Parallel Seq Scan in EXPLAIN ANALYZE .
Date: 2016-06-20 07:17:20
Message-ID: d1e8793a-7dfd-e9c5-5dcd-d380cf58567e@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2016/06/20 15:42, Amit Kapila wrote:
> On Mon, Jun 20, 2016 at 11:48 AM, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
> wrote:
>>
>> Hi all,
>>
>> My colleague noticed that the output of EXPLAIN ANALYZE doesn't work
>> fine for parallel seq scan.
>>

[ ... ]

>> For example, the above result shows,
>> Parallel Seq Scan : actual rows = 3333333
>> worker 0 : actual rows = 3457968
>> worker 1 : actual rows = 3741069
>> Summation of these is 10532370, but actual total rows is 10000000.
>> I think that Parallel Seq Scan should show actual rows =
>> 10000000(total rows) or actual rows = 2800963(rows collected by
>> itself). (10000000 maybe better)
>>
>
> You have to read the rows at Parallel Seq Scan nodes as total count of
> rows, but you have to consider the loops parameter as well.
>
>>
>> After spent time to investigate this behaviour, ISTM that the problem
>> is nloops of Parallel Seq Scan.
>> Parallel Seq Scan is done only once, but nloops is incremented to 3.
>>
>
> nloops here indicates, that it is done for 2 workers and a master backend.

Does the way parallel instrumentation info is currently handled allow to
also show the leader's info maybe like below:

-> Parallel Seq Scan on public.pgbench_accounts
(cost=0.00..205601.67 rows=4166667 width=0) (actual
time=0.042..1685.542 rows=3333333 loops=3)
Leader: actual time=x.xxx..xxxx.xxx rows=2800963 loops=1
Worker 0: actual time=0.033..1657.486 rows=3457968 loops=1
Worker 1: actual time=0.039..1702.979 rows=3741069 loops=1

Thanks,
Amit

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2016-06-20 07:29:45 Re: Actuall row count of Parallel Seq Scan in EXPLAIN ANALYZE .
Previous Message David Rowley 2016-06-20 07:06:09 Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype