Skip to content

Parallel Queries Not Launching Workers #3344

Closed as not planned
Closed as not planned
@mikewang333

Description

@mikewang333

Hi,

When I try to take advantage of parallel queries, I'm noticing that the planned number of workers is 2 but 0 end up getting launched and my performance is slow.

image

You can repro this with any GATHER MERGE like related queries e.g.:

CREATE TABLE test_gather_merge AS
SELECT
    generate_series AS id,
    md5(random()::text) AS random_text
FROM
    generate_series(1, 1000000);  -- Adjust the number of rows as needed

-- Query with ORDER BY to induce sorting with parallel processing
SELECT id, random_text
FROM test_gather_merge
ORDER BY random_text
LIMIT 100;

I've already tried upping things like max_parallel_workers and max_worker_processes and I noticed that with other postgres clients (e.g. Postico) the parallel workers are launched successfully so I assume it's not server related.

Strangely enough if I run the queries with "Explain Analyze" in front, the parallel workers are launched successfully and execution is much faster.

Anyone have any idea why parallel queries using this SDK are not executed with parallel workers?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions