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 1ro4N6-00GuB6-P7 for pgsql-admin@arkaria.postgresql.org; Sat, 23 Mar 2024 16:37:29 +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 1ro4N4-00AN0f-Ut for pgsql-admin@arkaria.postgresql.org; Sat, 23 Mar 2024 16:37:27 +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 1ro4N4-00AN0X-Jb for pgsql-admin@lists.postgresql.org; Sat, 23 Mar 2024 16:37:27 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ro4N2-0066Um-52 for pgsql-admin@lists.postgresql.org; Sat, 23 Mar 2024 16:37:26 +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 42NGbMXp1409590; Sat, 23 Mar 2024 12:37:22 -0400 From: Tom Lane To: James Pang cc: pgsql-admin@lists.postgresql.org Subject: Re: create index concurrently blocked by other query In-reply-to: References: Comments: In-reply-to James Pang message dated "Sat, 23 Mar 2024 21:29:55 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1409588.1711211842.1@sss.pgh.pa.us> Date: Sat, 23 Mar 2024 12:37:22 -0400 Message-ID: <1409589.1711211842@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk James Pang writes: > PGv14, it's a time range partition table, we first create index ... on > ONLY parent table and it's done very fast, then we are doing "create index > concurrently ... on each partition table", then we saw it blocked by some > other sessopm "select on other tables" , is it expected ? Yes, read the documentation. CONCURRENTLY avoids blocking other transactions, at the cost of being easily blocked itself. regards, tom lane