Re: BUG #18588: Cannot force/let database use parallel execution in simple case.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18588: Cannot force/let database use parallel execution in simple case.
Date: 2024-08-22 22:52:40
Message-ID: 2088498.1724367160@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

David Rowley <dgrowleyml(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Rowley 2024-08-22 23:11:40 Re: BUG #18588: Cannot force/let database use parallel execution in simple case.
Previous Message David Rowley 2024-08-22 22:44:27 Re: BUG #18588: Cannot force/let database use parallel execution in simple case.