Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w7x8M-0004Ez-0X for pgsql-general@arkaria.postgresql.org; Wed, 01 Apr 2026 15:05:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7x8K-000rhe-3C for pgsql-general@arkaria.postgresql.org; Wed, 01 Apr 2026 15:05:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w7x8K-000rhV-2E for pgsql-general@lists.postgresql.org; Wed, 01 Apr 2026 15:05:29 +0000 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w7x8I-0000000023f-2S2Z for pgsql-general@lists.postgresql.org; Wed, 01 Apr 2026 15:05:28 +0000 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-8d006a80ccbso879800385a.2 for ; Wed, 01 Apr 2026 08:05:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775055924; x=1775660724; darn=lists.postgresql.org; h=in-reply-to:from:content-language:references:to:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=l4XtW6qQlFdez09f/+A0G6e5p992NHY5Rpv60pYd7Pk=; b=fTRBLkTzPLqwfSBW3JUxAzDboDexj8paVlMamIqKainDOR16uwva8FfkrJqlyMtCs6 OPqCbEHwreQsOUCsdYWngT1p/LZ8tZG93NEydJmXXpSCdPMamM7RcoTI1Z5ssBk/abhg jMmRq3Jq8NCBGJTwTXCJskrgxwWMH93f4JdtNe85qjQWWHY8+1xBYMbIFSGOEp7ih17J qKLlumCl7inVj3AOn+bCWPMl/gOSSEHO8LiP0jB2coqSM25vHkNz/H9ojJPZWn4VQFkM +fVOTtcdDxHAnxognnhJ0Q1oOlpJiNkjGnu2mUyGfRJ4oUGKSa+1HF9lPl9DJpJK0IwA fKEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775055924; x=1775660724; h=in-reply-to:from:content-language:references:to:subject:user-agent :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l4XtW6qQlFdez09f/+A0G6e5p992NHY5Rpv60pYd7Pk=; b=UvICYmmLC6ewU6VBe/xazUJ4SndxEFtTp1n44/iWakimUFdgzUW5UDpqqtmwsJfVpQ DScVg93J7cs2sZr3ELzJT+9sGU+3P+Nc6ObXorsXg27QIJwGzH9U6IHwt1qCf1n5SVpc sx1mOzmz+V34myj4VDev9KKjILjDNtCHLfVJhxgNTrkbAw046qoohmJMLL6GeejOyobw DPX+7feBJSj5q5qWhW4C3AljYHEMDQZdYlsaEWIzmg6M8JJ0Jvfjsshwsggy9pCYOnP9 jyF0DtLxYnoVFXM6RlxU6hYscDiEL0nL/GRScC889T8ZgoCyNSZ/tfyIWnOPz8+9lqpr cWjA== X-Gm-Message-State: AOJu0Yxk64+wztyS0QAejYALukQw8FSetIi+FKNjDjqQ8gWhQkoMbzy9 z+FEGnk4tB4Avy7HTpIX3UksfbOjZfr/+vUoUSbiZR08+SrXtUh0FnqqGtCAGLqj X-Gm-Gg: ATEYQzwedn6xu/m5n+KPeunUy7GINOiAJNLgZwnJpXT4ZXC+hXTz3UEUdyqIUUXZm2m MIVFW7KAb97Am2KQAPkUdQaYbq8y1YUfhiuoWvsceZ5lo+0v5DEkz0RsL3Lr4vLNhBaO31TjKwa Lpvme73IXymPRjIBtJcLFc4t+TS5nOX6MjRDNkjR03dQk4+INPrUrvThM7YhXs3UggVxCFEYWUE 3LvZATOVNq35aYO8BAYWGvUiVqR1Zo0ge1/FGdN1CduBt/Qk1twDoCOYfr/8BZguh/5c4VAO0Yi FelqQtiQF3b0fYnymAMvh36jtaKaSPJHTf0w82ndJV+8eMeK5gimDBBWNVlRFCsPrTbP1BkXy4l m69QcIxQBlXvWxDcHc2wek2weTGugbR0qHbbVQsD7mHqQ/KwxanLUOwacgcLPXAnUYefOarakU2 W7mBqlMvx0NB6BNoHEUoveA1E= X-Received: by 2002:a05:620a:28c5:b0:8cf:c30c:ced5 with SMTP id af79cd13be357-8d1b5aaaedamr595011585a.14.1775055922328; Wed, 01 Apr 2026 08:05:22 -0700 (PDT) Received: from ?IPV6:2a07:b944::2:2? ([2a02:6ea0:e20d:2691::13]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8d027f06ee8sm1388113685a.14.2026.04.01.08.05.20 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Apr 2026 08:05:20 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------0ayNUl0hpkHJrdhOrMvKLGYl" Message-ID: <0b2865ee-b220-48c1-9314-86aa34048503@gmail.com> Date: Wed, 1 Apr 2026 11:05:20 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: How to query with more workers on a large table with many partitions To: pgsql-general@lists.postgresql.org References: Content-Language: en-US From: Greg Hennessy In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------0ayNUl0hpkHJrdhOrMvKLGYl Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit > I'm running PostgreSQL 16 on an AWS EC2 instance with 16 logical > processors and 128G of RAM. How can I get PG to run the query with > more workers? > Postgres allocates more workers based on the log3 of the ratio of the table size to min_parallel_table_scan_size. You may want to try |ALTER TABLE ... SET (parallel_workers = 10) (or whatever your desired value is). | --------------0ayNUl0hpkHJrdhOrMvKLGYl Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
I'm running PostgreSQL 16 on an AWS EC2 instance with 16 logical processors and 128G of RAM. How can I get PG to run the query with more workers? 

Postgres allocates more workers based on the log3 of the ratio of the table size to min_parallel_table_scan_size.

You may want to try ALTER TABLE ... SET (parallel_workers = 10) (or whatever your desired value is).

--------------0ayNUl0hpkHJrdhOrMvKLGYl--