Re: Parallel Seq Scan vs kernel read ahead

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Soumyadeep Chakraborty <sochakraborty(at)pivotal(dot)io>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parallel Seq Scan vs kernel read ahead
Date: 2020-05-22 02:26:44
Message-ID: CA+hUKGKSAS=pgdNKG5o2OseKvuBac7WALEXG-B19c1CWdLCX2g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 22, 2020 at 1:14 PM Soumyadeep Chakraborty
<sochakraborty(at)pivotal(dot)io> wrote:
> Some more data points:

Thanks!

> max_parallel_workers_per_gather Time(seconds)
> 0 29.04s
> 1 29.17s
> 2 28.78s
> 6 291.27s
>
> I checked with explain analyze to ensure that the number of workers
> planned = max_parallel_workers_per_gather
>
> Apart from the last result (max_parallel_workers_per_gather=6), all
> the other results seem favorable.
> Could the last result be down to the fact that the number of workers
> planned exceeded the number of vCPUs?

Interesting. I guess it has to do with patterns emerging from various
parameters like that magic number 64 I hard coded into the test patch,
and other unknowns in your storage stack. I see a small drop off that
I can't explain yet, but not that.

> I also wanted to evaluate Zedstore with your patch.
> I used the same setup as above.
> No discernible difference though, maybe I'm missing something:

It doesn't look like it's using table_block_parallelscan_nextpage() as
a block allocator so it's not affected by the patch. It has its own
thing zs_parallelscan_nextrange(), which does
pg_atomic_fetch_add_u64(&pzscan->pzs_allocatedtids,
ZS_PARALLEL_CHUNK_SIZE), and that macro is 0x100000.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-05-22 03:50:28 More tests with USING INDEX replident and dropped indexes
Previous Message Soumyadeep Chakraborty 2020-05-22 01:14:37 Re: Parallel Seq Scan vs kernel read ahead