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

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: 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 14:34:22
Message-ID: CAApHDvqGgO7c8N0kq5H4jZ0NZe=NGZDo4VVF5Fi5CVdJNbvStg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, 23 Aug 2024 at 01:14, PG Bug reporting form
<noreply(at)postgresql(dot)org> wrote:
> set min_parallel_index_scan_size to '8kB';
>
> set min_parallel_table_scan_size to '8kB';
> set parallel_tuple_cost to 0;
> set parallel_setup_cost to 0;
>
> have no effect.
>
> Even with the set force_parallel_mode to on - no effect:
> negotiation_chat_archive=# explain analyze select topic_id as y0_ from
> public.negotiation_topic_archive_p005 this_ where
> this_.employer_id='816144';

Does it choose a parallel plan if you do:

ALTER TABLE public.negotiation_topic_archive_p005 SET (parallel_workers = 2);

I assume it must be a btree index given the other plan does use a
parallel scan. So I wondered if something weird was happening in
compute_parallel_worker() and it was choosing 1 worker, which might
cause the path to be rejected.

You might need to come up with a self-contained test case here as when
I tried this on PG15, I do get a parallel index scan.

create table t1 (a int);
insert into t1 select x/1000 from generate_Series(1,1000000)X;
create index on t1(a);
set min_parallel_index_scan_size to '8kB';
set min_parallel_table_scan_size to '8kB';
set parallel_tuple_cost to 0;
set parallel_setup_cost to 0;
explain select * from t1 where a < 10;
QUERY PLAN
--------------------------------------------------------------------------------------------
Gather (cost=0.42..179.40 rows=8912 width=4)
Workers Planned: 2
-> Parallel Index Only Scan using t1_a_idx on t1
(cost=0.42..179.40 rows=3713 width=4)
Index Cond: (a < 10)
(4 rows)

select version();
version
-------------------------------------------------------------------------------------------------------
PostgreSQL 15.6 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu
11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit
(1 row)

David

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kuntal Ghosh 2024-08-22 15:14:22 Re: BUG #18559: Crash after detaching a partition concurrently from another session
Previous Message PG Bug reporting form 2024-08-22 12:58:23 BUG #18588: Cannot force/let database use parallel execution in simple case.