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

From: Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David Rowley <dgrowleyml(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 20:27:24
Message-ID: CAK-MWwRK4BYqEn-SxoMSb5iFr+fhTuKgS5kFrH=awPTrYDEtpg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Aug 22, 2024 at 10:01 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com> writes:
> > Ok there are reproducer test case on the stock postgresql 16.4 config:
>
> Hmm, you can see both behaviors on the small version of t1, just by
> varying the comparison constant in the WHERE clause. For me, it'll
> use only one worker with "where a<1", and not parallelize at all
> with "where a<0". It looks like it's deciding that it's not worth
> starting workers when too few rows are expected to be returned. That
> would be unsurprising with a normal setting of parallel_setup_cost,
> but it does seem odd with parallel_setup_cost=0.
>
> In any case, I think this isn't about the big table being big but
> about changing the range of values of "a", which changes the
> selectivity of "where a<10" 100-fold.
>
> (I tested on HEAD not v16)
>
> regards, tom lane
>

I especially designed both tests in a way that the expected amount of rows
- is the same in both cases.

With sufficiently large table - I didn't manage find a combinations of
settings to force parallel execution (im my real case - the database huge
and mostly cold on ssd raid - so parallel execution provides almost linear
speedup with amount of parallel workers even on 1000 rows... not talking
about 10k-10m rows, but I cannot convince the PostgreSQL use parallel index
scan for 2m returned rows case).

--
Maxim Boguk
Senior Postgresql DBA

Phone UA: +380 99 143 0000
Phone AU: +61 45 218 5678

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2024-08-22 20:42:03 Re: BUG #18588: Cannot force/let database use parallel execution in simple case.
Previous Message Tom Lane 2024-08-22 19:01:56 Re: BUG #18588: Cannot force/let database use parallel execution in simple case.