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 1w7wzk-00046G-1P for pgsql-general@arkaria.postgresql.org; Wed, 01 Apr 2026 14:56:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7wzj-000m6F-0q for pgsql-general@arkaria.postgresql.org; Wed, 01 Apr 2026 14:56:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w7wzi-000m67-30 for pgsql-general@lists.postgresql.org; Wed, 01 Apr 2026 14:56:35 +0000 Received: from mail-yw1-x1131.google.com ([2607:f8b0:4864:20::1131]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w7wzh-000000001i0-13DI for pgsql-general@postgresql.org; Wed, 01 Apr 2026 14:56:34 +0000 Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-793fdbb8d3aso40737327b3.3 for ; Wed, 01 Apr 2026 07:56:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775055392; cv=none; d=google.com; s=arc-20240605; b=Pdwv3fTzsqFyHT2+sLWTbutMwPHTEdgZK8ltpRlB7DDgjwfWqDyLpNRnFc88eRfhxQ QW4tRMyPLZhOZCR650JO3Aq/55DdxAOonKh7ChJPL+dLbZ9YWsZ1ia1RwUpri/NNKkNT f4KOHzi4xA1PglBPBdBxO248htjkp87TuhKF+QTFCkIbSbPEbczTX0cf8IoGGxQzIiab NhQ21PQlgsr+rBF+kaNX2krrpo4mY4gq3eCqmn76jxu/M65mHG6N7jXv/IZSqWcCT/ek rW6VKFW79XQr9Vt+VAFdUBGaO2+gHGZfM/HyS7eg5EjQBpVn476NAsmVh4nb7ateeu6M BABw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=eG1yWYO7qye9GQHq2iprdrut4B44BnyJJUHmIvjBp9g=; fh=BVuptWvcqVGjpLXAcHdZy0e0PQa6XH8krFkuQRq3g8I=; b=MlaylyoHYqPft0PaF/Js7r8niw90iuFwyN1yi+IYl/ntN4bEnIrxocBjINcL/UkTum 4wE5fv4Sm1YpNPlmHwtESA7qvURkEh+auHIliMbIpqz0AtjqnIYuO1yPWeXcVZHVNTbQ FbUV6cfyc4Pmi6OEN7nduG+f743LrDzBjQhXEXAtl0o52+mUIewkhirI8lA70nV+WtqX P0rTzyJeJrNNakL/XUclOYHAqh3olJx+2fSBh7sZ9GshIUcMcSi7s2Ktn9SX0YeIvfQ4 4oLZ6uQXIOucNiEb23oFVAfikNDMX8HmW9zWiNvk3BCCV1UwTvGyzHodnJdS68a1zMSh XWHw==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775055392; x=1775660192; darn=postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=eG1yWYO7qye9GQHq2iprdrut4B44BnyJJUHmIvjBp9g=; b=Dfmjwau3QYK+p7lHwu4BtbSe4Xvnpth5XnTAGM34eed8EoxinH4ATkCnV2DVNfubpE HDLjgiCnfhx6LyfjnxiY0ozU6nE7qujW20Nhd/mvyxdrJx+Cem0WodczyrzrStvGhnca Vz0VPXXThjaHk5YiXxF8rIeD9xuuhz1R89vdi3ByDLlFXyKEpMjK7UuRMeliasIjRzje qa4N1nBFXVbMLo/p9oezDf7xtw/eGhBwBqj4YSuVqxU8hiaVr35RHi5GVTtjqeQsroaQ w2ckKqjK1FUATJN2qjIfy96p5f02ftAn2lXQMFQ226U9s6KhIRsvE81yvjNJcZjFN5/a P92Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775055392; x=1775660192; h=to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eG1yWYO7qye9GQHq2iprdrut4B44BnyJJUHmIvjBp9g=; b=emMs/mAnGgctvnv3PUvC9B/0gt6EzOlvQIGFP3taGqHkPKlYdH0y+tOGBvAGuPvAPQ XVwVFo+nS3s+zLSlXJmClpV4tONBCg4nyg0v8CLZg6Osm6V76c8Qf1HAVayWTsBUltAr gPl9iXpUmt22byyYkTsFJ/gbqBk3zNiRF5L5wqt4Pp1dUmIQxIPJOF6RaaKVXT6z/N+T lt6rNCOits8Vmneu6m/mcp5ytSus0vt0Gem1LesiLqr0Ivl6TgI0OloFtFBEwLEQk8iD XM40RiG0lq9Zy5j1+pEV0dRnubvnFwIns0vF4N+KToPLEl7hSOiVs2AKXJbMxJQcYY+P tg9Q== X-Gm-Message-State: AOJu0Yx6soy8lXsGsggKzoWL4I6x0Pb51BKroA+0rcNA1iV1WXU46OJv Hg5lzGKM57BI/MVJW6ITKauGF9p/SgpDkTLofbHRxXoe7hFF1BjfGzkdtUoIu/Ax87JsDJpUuWp OeNTUR64m48L2KkcWnHiYJbNadeqotRLuVewl X-Gm-Gg: ATEYQzwA5h1A0k1oGdDz1JIw9iRgOFddj2y96AKKCIumKdr9vQeMj22+IaDvy0IACrF VmDrwTudpLOHdkmPTsCbUhngXIvkWGAzH5heglLH8Z5Kfw2MpETTJeLze1M7ASjV3Aql2CzGnaw SYAtuPeEOVAFhqf0KyY1lv6FEtYGeqT95pQYzGzM17ZRuSfbWtcdgrCWEV80sdWn//4T0QeldN0 /Gok3Ir9MkakdtXtt6Jnrdd7w/HKdzOosV85Dr2eWJ4L2aEYdGXWlulNe+ofuwisRpN0YrZdxv0 38T+ilSQyv8ftWxZi74tBRWuVHMDIy+YxLla X-Received: by 2002:a05:690c:920f:b0:79a:d277:21cb with SMTP id 00721157ae682-7a2100bf48dmr36475937b3.16.1775055392144; Wed, 01 Apr 2026 07:56:32 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?Q?Gabriel_S=C3=A1nchez?= Date: Wed, 1 Apr 2026 10:56:20 -0400 X-Gm-Features: AQROBzCZJB5BmeX35iCpi-BokVaB5r5nJ6OmX2bvSp5fPLkGSUI-l-s6I09J7Yc Message-ID: Subject: How to query with more workers on a large table with many partitions To: Postgres General Content-Type: multipart/alternative; boundary="0000000000001aff87064e674a35" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000001aff87064e674a35 Content-Type: text/plain; charset="UTF-8" Hi PostgreSQL community, I have a large table (86 GB) that is declaratively partitioned by year, sub-partitioned by month, and sub-sub-partitioned by day. It currently has 437 leaf partitions, and will continue to grow with a new partition each day. When I query a simple count(*) by date, the query planner plans a query with five workers, but I have the following in postgresql.conf: max_worker_processes = 12 max_parallel_workers_per_gather = 12 max_parallel_workers = 12 shared_buffers = 32GB temp_buffers = 1GB work_mem = 512MB The top-level partitioned table has been ANALYZEd. 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? Thank you, Gabriel --0000000000001aff87064e674a35 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi PostgreSQL community,

I h= ave a large table (86 GB) that is declaratively partitioned by year, sub-pa= rtitioned by month, and sub-sub-partitioned by day. It currently has 437 le= af partitions, and will continue to grow with a new partition each day. Whe= n I query a simple count(*) by date, the query planner plans a query with f= ive workers, but I have the following in postgresql.conf:

max_worker_processes =3D 12
max_parallel_workers_per_gath= er =3D 12
max_parallel_workers =3D 12
shared_buffers = =3D 32GB
temp_buffers =3D 1GB
work_mem =3D 512MB
<= div>
The top-level partitioned table has been ANALYZEd.
=

I'm running PostgreSQL 16 on an AWS EC2 instance wi= th 16 logical processors and 128G of RAM. How can I get PG to run the query= with more workers?=C2=A0

Thank you,
Gab= riel


--0000000000001aff87064e674a35--