pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Maxim Boguk <maxim.boguk@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18588: Cannot force/let database use parallel execution in simple case.
Date: Thu, 22 Aug 2024 18:52:40 -0400
Message-ID: <2088498.1724367160@sss.pgh.pa.us> (raw)
In-Reply-To: <CAApHDvqVvFz1L-Yxyts+Q4+rbyuOmsJwFK9=pJwQS=cukb+z0g@mail.gmail.com>
References: <18588-204730f9394441a8@postgresql.org>
	<CAApHDvqGgO7c8N0kq5H4jZ0NZe=NGZDo4VVF5Fi5CVdJNbvStg@mail.gmail.com>
	<CAK-MWwTqDRerxrpaN8Xb25DqDGBw1UT+YSkfp4QN-MgOH97c+Q@mail.gmail.com>
	<CAK-MWwS_ZAsaGrz0byqCO38NNrNqPkNt1ww1dorHz_wiaFbWvw@mail.gmail.com>
	<2059550.1724353316@sss.pgh.pa.us>
	<2073208.1724359323@sss.pgh.pa.us>
	<CAApHDvqVvFz1L-Yxyts+Q4+rbyuOmsJwFK9=pJwQS=cukb+z0g@mail.gmail.com>

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





view thread (17+ messages)  latest in thread

Message-ID: <2088498.1724367160@sss.pgh.pa.us>
Permalink:  ../2088498.1724367160@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2088498.1724367160@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dgrowleyml@gmail.com, maxim.boguk@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18588: Cannot force/let database use parallel execution in simple case.
  In-Reply-To: <2088498.1724367160@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox