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.94.2) (envelope-from ) id 1ujUf9-008M4V-33 for pgsql-admin@arkaria.postgresql.org; Wed, 06 Aug 2025 03:17:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ujUe8-00DG13-Ny for pgsql-admin@arkaria.postgresql.org; Wed, 06 Aug 2025 03:16:56 +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.94.2) (envelope-from ) id 1ujUe8-00DG0v-AD for pgsql-admin@lists.postgresql.org; Wed, 06 Aug 2025 03:16:56 +0000 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ujUe5-000z0K-21 for pgsql-admin@postgresql.org; Wed, 06 Aug 2025 03:16:56 +0000 Received: by mail-oi1-x235.google.com with SMTP id 5614622812f47-43577ef82b7so205046b6e.3 for ; Tue, 05 Aug 2025 20:16:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754450211; x=1755055011; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=sQxd47U571hX7HTTmUiJQ3kwydQAs/sQTVY8Wd4XLSk=; b=cA7UAFO4YMtfVAESftqdkHxhwdh8cSqPh0MwdeDS02U0dupxQeVicqtCo1Pq+cFw2q Crvf+edXK+6ix/gvl/WEIzoLO28gWKKbZfzvVSZSKfGlsvGejXC9ecnbEJxx9sQ93WiK BCqcjBY2/3l5hIi3VwK37GzzM9DMQDTTYhWRIEwb2oGOOoi6dgPjkd71Gjl2yL8mRGY3 X+7DHifOJ6MWAYomqBlGZrXUoaXJrVe2lYza3FVy5u9KYfk1i+KEfpE35wZdkfT+q6Ef YXrKVLYbWuJKmi0U4UYQfePwV56Qrc2zp8BVnSTOcpwgVEkc25vW8pmIOTeiUbL5B+93 r8Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754450211; x=1755055011; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sQxd47U571hX7HTTmUiJQ3kwydQAs/sQTVY8Wd4XLSk=; b=bTrVzUx2mZdNZ3v75I2XnrF2HgQ58GvMyjAcE1XmtVV4bdbbNxo80XNgK6eZKrTEsF fGhkfgzMsTt2cNgUqlIk/+vMGu5orfN0PE7eLFjrmexNTTrLdOMlfQWBLAFlAQ4ckg6j 9V0bQV/ZD4bwMvUN1rnlJPbu9gmBC7dW5OqABdZhoHO0+ECG2Osv0TeP+T2OVqqsurQL pZ1WujnNek03r4dXhJBmao3T/yefrfQVAiWRZXrLypBjldwDApEVUj639j8icrg+m2OQ ohEKxI+jPBMBwW5AWf+RCu2Ezg1/DCFFd33uk6kk4l7JlTHHxI9q5GK80dbkRfn/ulBE COag== X-Gm-Message-State: AOJu0Yz9b0XP63uTqJ4uB6RRHsfHmPXONCunadhxpQveGNFi0IeajLZ9 toG0YPulhAPhrHnfWHpoPDv7sLdpyqtIpd+u2Co3iL6o9TSwKH8Xqqv6Us4flMAzl0qMzZ1hDVn 0dRcx6MkeAqXvatNJlucljg61bYez1AlcqWne X-Gm-Gg: ASbGncu/7m5c3ZinY+4AyrlT/syq8c+WS0hST7pEcULlf7pmqMecAgv4fbmirktv5d0 Dd8GcWtT3ycKT2c5qYGUi6jJSB2m0DiQqrhOVLLON9nl6CSM7sSR0vtzdYykfMU7WJP14LPOKKw /ztQyDRxVUmbeSOyLKbv3DrK0qqwMVJXR6iRyP8vSO1x8dowDrAaOfMD2oXWbDquY/DvC8mKUXK OchYOrs X-Google-Smtp-Source: AGHT+IHPQ+PfbYMSKYwcfMKYbd3JeTY0YI7n9kna5evQevXjclezfq0eEhtQwXu9S+Ykf1HHkXxDDPcnxrX2syVl4zc= X-Received: by 2002:a05:6808:4f68:b0:40a:a408:a32a with SMTP id 5614622812f47-4357a05dd4cmr1144267b6e.19.1754450211050; Tue, 05 Aug 2025 20:16:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ron Johnson Date: Tue, 5 Aug 2025 23:16:39 -0400 X-Gm-Features: Ac12FXwLVyFq10u7LXDHzPOVLjdzx4lPjnnsWaf-XwZfGJcKJJqR3zNNgm37Dd0 Message-ID: Subject: Re: Indexing Strategy for Partitioned Table in PostgreSQL 15.13 To: pgsql-admin Content-Type: multipart/alternative; boundary="0000000000009b19c8063ba9c5e6" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000009b19c8063ba9c5e6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Aug 4, 2025 at 1:25=E2=80=AFAM Mahesh Shetty wrote: > Hello Team, > > We=E2=80=99re running PostgreSQL version 15.13. > > I have a large partitioned table with around 100 partitions, and we're > planning to add an index to it. I'm a bit concerned about the potential > impact and duration of the indexing process, and I=E2=80=99d appreciate y= our inputs > on the following: > > 1. > > If I run CREATE INDEX CONCURRENTLY on the *parent table*, will it > automatically create indexes concurrently on all its partitions? > 2. > > Are there any recommended or more efficient approaches for indexing a > heavily partitioned table that I should consider? > > Search for "CREATE INDEX ON ONLY" in https://www.postgresql.org/docs/15/ddl-partitioning.html That'll tell you how to build indices in parallel and concurrently. --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --0000000000009b19c8063ba9c5e6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Aug 4, 2025 at 1:25=E2=80=AFAM Ma= hesh Shetty <maheshetty20@gmai= l.com> wrote:
=

Hello Team,

We=E2=80=99re running PostgreSQL version 15.13.

I have a large partitioned table with around 100 partitions, and we'= re planning to add an index to it. I'm a bit concerned about the potent= ial impact and duration of the indexing process, and I=E2=80=99d appreciate= your inputs on the following:

  1. If I run CREATE INDEX CONCURRENTLY on the parent ta= ble, will it automatically create indexes concurrently on all its = partitions?

  2. Are there any recommended or more efficient approaches for indexing a he= avily partitioned table that I should consider?


T= hat'll tell you how to build indices in parallel and concurrently.

--
Death to <Redacted= >, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
--0000000000009b19c8063ba9c5e6--