Re: BUG #18588: Cannot force/let database use parallel execution in simple case. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #18588: Cannot force/let database use parallel execution in simple case.
Date
Msg-id 2088498.1724367160@sss.pgh.pa.us
Whole thread Raw
In response to BUG #18588: Cannot force/let database use parallel execution in simple case.  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #18588: Cannot force/let database use parallel execution in simple case.
List pgsql-bugs
David Rowley <dgrowleyml@gmail.com> writes:
> I played around with the attached script and set some breakpoints in
> cost_index(). I'm seeing the same thing as you with the parallel path
> being only slightly cheaper, but when looking at cost_index(), it's
> easy to see why.

> It's only the cpu_run_cost that's divided by the parallel_divisor.

D'oh.

What Maxim is observing is that he's getting I/O concurrency from
multiple workers; and that's an effect we're simply not accounting
for here.  cost_seqscan excuses the same omission with

         * It may be possible to amortize some of the I/O cost, but probably
         * not very much, because most operating systems already do aggressive
         * prefetching.  For now, we assume that the disk run cost can't be
         * amortized at all.

but I don't think this prefetch argument applies to index scans.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Maxim Boguk
Date:
Subject: Re: BUG #18588: Cannot force/let database use parallel execution in simple case.
Next
From: David Rowley
Date:
Subject: Re: BUG #18588: Cannot force/let database use parallel execution in simple case.