Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3etT-0001SS-6f for pgsql-admin@arkaria.postgresql.org; Tue, 21 Jun 2022 14:30:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o3etR-0006R7-9R for pgsql-admin@arkaria.postgresql.org; Tue, 21 Jun 2022 14:30:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3etQ-0006Qo-VR for pgsql-admin@lists.postgresql.org; Tue, 21 Jun 2022 14:30:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3etO-0002eH-Dy for pgsql-admin@lists.postgresql.org; Tue, 21 Jun 2022 14:30:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 25LEU1xg2944694; Tue, 21 Jun 2022 10:30:01 -0400 From: Tom Lane To: "James Pang (chaolpan)" cc: "pgsql-admin@lists.postgresql.org" Subject: Re: multiple sessions to create index in parallel support In-reply-to: References: Comments: In-reply-to "James Pang (chaolpan)" message dated "Tue, 21 Jun 2022 10:18:20 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2944692.1655821801.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 21 Jun 2022 10:30:01 -0400 Message-ID: <2944693.1655821801@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "James Pang (chaolpan)" writes: > We have a large database that just migrated data from Oracle to Postg= res(13.4), after data load. We try to create indexes , with only one conn= ection , the create index automatically run in parallel (table size 40G) ,= then we started two connections and each session creating index on large= table, but at this time, only 1 session parallel creating index, the othe= r one creating index in serial. There are enough parallel_workers and memo= ry. Is that expected ? only 1 session allowed to parallel index creating= at the same time ? Check your settings for max_parallel_workers and max_parallel_maintenance_workers. regards, tom lane