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 1wcZAi-003SAS-04 for pgsql-general@arkaria.postgresql.org; Thu, 25 Jun 2026 01:46:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wcZAe-003Dcd-1F for pgsql-general@arkaria.postgresql.org; Thu, 25 Jun 2026 01:46:24 +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 1wcZAe-003DcV-0D for pgsql-general@lists.postgresql.org; Thu, 25 Jun 2026 01:46:24 +0000 Received: from mail-ua1-x944.google.com ([2607:f8b0:4864:20::944]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wcZAb-000000007ba-1YcN for pgsql-general@lists.postgresql.org; Thu, 25 Jun 2026 01:46:23 +0000 Received: by mail-ua1-x944.google.com with SMTP id a1e0cc1a2514c-968fdcfa6e7so25385241.0 for ; Wed, 24 Jun 2026 18:46:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1782351979; cv=none; d=google.com; s=arc-20260327; b=I0VSEJlVLXdZ7P9DzxUTTvPLsmJa6pRHM3Nv05QKPoBqqmJHtyHpJeI/PJM8mjYtdU 1BbZgvqlgu6JDQwind1KbM4yXwUdpiVnCqvjIjDoHklCMi+BvjcntEBfjmciMHTxSNy2 mB5x69Grx7b248Pn5FYYoc6Q5jEohG/I0RGinMA6GfYf3WPW0t+KkML1iqFFdnWRChHY FhqXI8Nd8+W6nAUMFLwmBajT0j9f3yCdKkUOJ6X5jQYOhXDr9+YtBT7KXtTvILUrTyiM 4EuDmwKJ9MozNsh3HFy2xwYWIHvFGLW7GvEpN/k04H93lI9baooGEIu7TTuPuQsQd6+j SxEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=Gm585nuSfDfb9+Fvg2puZQ773stw0Gw/AAMxk6BnwSI=; fh=4rCG0PM8n0FOokGy8sSWDJpgPdCgp6yIXcpABJ7tUh0=; b=KLtv7RVUoAqBBKRhSAQ//7PbypKks9HAPQxaZwxi8EJs5qO1t1vHmw+59ADxuER08Q RsGcEoU/4r07H995AtvcOneKubv38u0M5wGNFxT4zo/orOcOPxYb+Nj0fYSVO1KRDHJu FKZGa1IFUgprA6bHYfY5DOZM94GH+A4VNV/Ty3/mEJJUhFW7/SHSRi6ynhD5+qXLkOx+ r+mwtY5tn3Tb4uoKCQnj9JDAIDKSrqJzUKdHyyZXiye5ACO114rrY/XWcJ3ItiYpJV2T iuZBsOaL34QtewWGsqC6zKAz0i+W0W2gZp8iaKAbgtHt+VVuIjk+G5K8TSorl90PKx6h PDbA==; darn=lists.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=1782351979; x=1782956779; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Gm585nuSfDfb9+Fvg2puZQ773stw0Gw/AAMxk6BnwSI=; b=YrWcSvA7UM2C1iC/f7zc7TnOj3CoKlUyQ6wYcTRx182PEfdIvC2FXQ1ED5wPokocF2 JnXft6sb7I8iNKwTsk0mxSEz1DnYyAGzj4MUMV/8MHKjRz/HwIvv9HkTOtnL4rDXtBk8 KCI4p6Bh8/8wZiAo0xfAbabZybVxPbjYFm9chD5jnC8SYU/+JTm+cC5KK57oE2AwViHW FCk6pvlJK+fHhdk2UvRXVQrEl8RdzEXis+QNP5FPA5BEcIj6a3J1J4JPjLvulI7QM88z rDO7vyYmlhYqYXj5+Dsxx7xwt6q+/jfD6ap9kau5Qk8EfKboaQnSP4lLIepPbsnVTfz2 7T3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782351979; x=1782956779; 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=Gm585nuSfDfb9+Fvg2puZQ773stw0Gw/AAMxk6BnwSI=; b=KfNtSyAb8Wo3LRQuYVlkzbubFH1Q4J8NtzspFy3e98ef1oDiQvAOQr/u9yFWC09uSm N3iSWJzpPPehsbZMxcyyTsQioNsKLPzkudhyfy9Oi0McejdgSAmlYQXc5HU1Mszzcqqr wmCuP8wK0clvDTgpgqC1L4TKin3OwXkIWzVUlfmrsFrgIl9kFgF+WSuqxfughJzTclpM 3+hDUZJAJAla7fhOxfJr2+CsvAEbGoXbxh2iIUbqgnPfzpH9z011JlIsx4MfPskUfFX3 rgAYXCMmg6S3gAdDgSoU4MGoEWWAQCpRiPC0+UNKHnTCi4xdfyH2PcJBMLcDsSfJc2Bu r36w== X-Gm-Message-State: AOJu0Yzd+TtOwRqYs/Z039FadUyz/v/IzkN2KtrrdaN49ZTvD835OZro b7S4f9zCfxGq/CTU+Ua1KmXsrZJFMuzgEdQhkOmE5fPzSE0kfdsuoN+vf8qWHA9pavK64gtrjZC 0zq16kEs4e/sa14no6dbk22LQ2XTlUaIY7aqQgE0= X-Gm-Gg: AfdE7ck5PTW8OukCW/dHlOhZ9dg3GFEBUYcZ+UaPo+JRgIbWGzHZiR34PTbD1SV5RVT siF0Lxhz5bRYqu3a5POY65LDMEO9POj8FSm5Ezp+K3gnynhIKFjjzUKBMmQ6ldHB1nQdhAJDcvS JxXT7dIfFKrizD2zBhZseMXnrf8vX+2i5cNx5KmnCqWCfBHuOVgCjQrSq+IAZkxso6AJ9PF+Ntp dgWyhPiAvkO74W799xxp2hO67mJg9qzn9rw/4X25PMFgxu4ohicAyTSv9wRjcPZg46QgscaAQ== X-Received: by 2002:a05:6122:4fa8:b0:5a0:9ad4:700e with SMTP id 71dfb90a1353d-5bd69c31fd3mr139174e0c.3.1782351978603; Wed, 24 Jun 2026 18:46:18 -0700 (PDT) MIME-Version: 1.0 From: Sivaprasad Date: Thu, 25 Jun 2026 07:16:07 +0530 X-Gm-Features: AVVi8CfKkfGFPKwf3XRi9adrGGCc_rZmQ1YodMgjBKHVcpIfTLjDOGG52MnYRIU Message-ID: Subject: Pre-PG18 parallel scan estimation: accessing planned worker count from amestimateparallelscan() To: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000008ca95d06550a284a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000008ca95d06550a284a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, While adding parallel scan support to the Biscuit index access method, I ran into a question about the pre-PG18 parallel scan API. Biscuit partitions scan work into a fixed number of segments at estimation time and assigns those segments to parallel participants via a shared-memory descriptor in the DSM segment. Because the segment layout depends on the number of participants, we need the planned worker count during amestimateparallelscan() =E2=80=94 the only callback that both sizes= the DSM allocation and runs in the same process immediately before aminitparallelscan(). The callback signatures across versions are: - - PG16: Size (*)(void) - PG17: Size (*)(int nkeys, int norderbys) - PG18+: Size (*)(Relation, int *nworkers*, int nchunks) In PG18+, nworkers is available directly. In PG16 and PG17 it is not. My question: prior to PG18, was there any supported mechanism by which an index AM could determine the planner's intended parallel worker count during scan estimation? Thanks, Sivaprasad Murali Biscuit index access method --0000000000008ca95d06550a284a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hello,

While adding parallel scan support to the= Biscuit index a= ccess method, I ran into a question about the pre-PG18 parallel scan API.
Biscuit partitions scan work into a fixed number of segments at estim= ation time and assigns those segments to parallel participants via a shared= -memory descriptor in the DSM segment. Because the segment layout depends o= n the number of participants, we need the planned worker count during amest= imateparallelscan() =E2=80=94 the only callback that both sizes the DSM all= ocation and runs in the same process immediately before aminitparallelscan(= ).

The callback signatures across versions are:

    • PG= 16: Size (*)(void)

    • PG17: Size (*)(int nke= ys, int norderbys)

    • PG18+: Size (*)(Relation, in= t nworkers, int nchunks)


  • In PG18+, n= workers is available directly. In PG16 and PG17 it is not.

    My questi= on: prior to PG18, was there any supported mechanism by which an index AM c= ould determine the planner's intended parallel worker count during scan= estimation?=C2=A0

    Thanks,
    Sivaprasad Murali
    Biscuit index acc= ess method

    --0000000000008ca95d06550a284a--