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 1sGAny-00A2uG-Ot for pgsql-general@arkaria.postgresql.org; Sun, 09 Jun 2024 05:09:23 +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 1sGAnx-002mww-A4 for pgsql-general@arkaria.postgresql.org; Sun, 09 Jun 2024 05:09:22 +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 1sGAnw-002mwo-Ul for pgsql-general@lists.postgresql.org; Sun, 09 Jun 2024 05:09:21 +0000 Received: from mail-yb1-xb2d.google.com ([2607:f8b0:4864:20::b2d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sGAnr-000ivu-J2 for pgsql-general@lists.postgresql.org; Sun, 09 Jun 2024 05:09:21 +0000 Received: by mail-yb1-xb2d.google.com with SMTP id 3f1490d57ef6-dfb033d25f7so100405276.3 for ; Sat, 08 Jun 2024 22:09:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717909754; x=1718514554; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=oCKElwGkvwBp8ey8eceEcf1NIHGoPy4EOw+HXcQXk64=; b=gl9AJwjAFFgLo1owx5r7CSunsGY1p75T+RrajR+7ewIXm7bgqy7Xfxd/VwKrw9IH02 jL3PJSbztriCbEpaM91uJh/N4V5D1AntAS8KoYlOVY/Ip+HMnxxBnRBzP8lbMqEtNoJ1 ocGCH4R4z+5MkTlV4EMqbhsY/Xmsm8BF7/MYBf9qq87TebtHKzbxbO4RjIV7qh1AkqVQ a1RDpdjz9MMI5s4sFegHGsbbT9Yd2TnEUOHyuItIsb+zrEDzqrNlWCuuAdcJhCjvat81 L3wlJkJbdAJ14IgHkOJvXFI2FARZmEMDiJWeR9Y50ykIa4+xVbq61o03p/GlAwSHnNDh 51pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717909754; x=1718514554; h=cc: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=oCKElwGkvwBp8ey8eceEcf1NIHGoPy4EOw+HXcQXk64=; b=otPpstOvhhmeEer9ZFF1i/hPYCJewwNtAzJQ33TrSK+OiblpE4lFqwVJmyiyiUVMWd 8jJ2InE4UGWzE1+NSfxXaJNBFneYgCZjrUd09hg5Zwl1XzM9sadz/RH6mAneOymuB+qv srbPw5VSnuZ1WH+i5nzBw8sxdghi845TBBcckPqh+Knsaz7DJJ4ZN/grKGu5i8WQ/Tqa cL/cBEtKqJXLph0xFTVH67yD+gLzX3A+hcH6WvpBb4b1oV/i+nILIAg28ojo7aMtitJ6 lnhQPcX3BTGCUBb0kP6JHEGvuJPf/20LbBAyeEMuA4kuHmD8FcW3SkaMs4Iz+j7utOnF q+xg== X-Gm-Message-State: AOJu0YyymATpuliG3ZXh6+/4OKNnKpgrcYWAMgxbOjgJX1fue1jyNKDX 1GWnpBQYceM2CA96ZKWS86G6HH6wFpLhCmb35yxvh82D9oXx6/CdcIYmU1CZFfI3g2qByvP8nQx K4nbwJEqyjaPRolhdmda7iLSYqKw= X-Google-Smtp-Source: AGHT+IGEnQ8Nu4kPESdp9vike3zndNaCQpomg4sgIxjZSOB7ptMwCg8fJQpvNCxsBOrn3tqvbCaoe/GjPu/6Zq/9Tm0= X-Received: by 2002:a05:6902:4a8:b0:dfa:705c:6e3e with SMTP id 3f1490d57ef6-dfaf62ab77dmr4187814276.0.1717909754153; Sat, 08 Jun 2024 22:09:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Lok P Date: Sun, 9 Jun 2024 10:39:01 +0530 Message-ID: Subject: Re: Creating big indexes To: sud Cc: pgsql-general Content-Type: multipart/alternative; boundary="000000000000a71b41061a6e0858" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a71b41061a6e0858 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Jun 9, 2024 at 10:36=E2=80=AFAM sud wrote: > > You can first create the index on the table using the "On ONLY"keyword, > something as below. > > CREATE INDEX idx ON ONLY tab(col1); > > Then create indexes on each partition in "concurrently" from multiple > sessions in chunks. > > CREATE INDEX CONCURRENTLY idx_1 ON tab_part1(col1); > CREATE INDEX CONCURRENTLY idx_2 ON tab_part2(col1); > > After this step finishes the table level index which was created in the > first step will be in valid state automatically. > > Thank you so much. Should we also tweak the parameters related to the parallelism and memory as I mentioned in the first post? --000000000000a71b41061a6e0858 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, Jun 9, 2024 at 10:36=E2=80=AF= AM sud <suds1434@gmail.com>= wrote:

=C2=A0Y= ou can first create the index on the table using the "On ONLY"key= word, something as below.

CREATE INDEX idx ON ONLY= tab(col1);

Then create indexes on each partit= ion in "concurrently" from multiple sessions in chunks.

CREATE INDEX CONCURRENTLY idx_1=C2=A0 =C2=A0 ON tab_part1(c= ol1);
CREATE INDEX CONCURRENTLY idx_2=C2=A0 =C2=A0 ON tab_part2(col1);

After this step finishes the table level index = which was created in the first step will be in valid state automatically.


Thank you s= o much.
Should we also tweak the parameters related to the parall= elism and memory as I mentioned in the first post?=C2=A0
--000000000000a71b41061a6e0858--