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 1o6BI8-0001vf-0r for pgsql-performance@arkaria.postgresql.org; Tue, 28 Jun 2022 13:30:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o6BI6-0005ej-KX for pgsql-performance@arkaria.postgresql.org; Tue, 28 Jun 2022 13:30:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o6BI6-0005bX-AZ for pgsql-performance@lists.postgresql.org; Tue, 28 Jun 2022 13:30:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o6BI2-0004Gs-R9 for pgsql-performance@lists.postgresql.org; Tue, 28 Jun 2022 13:30:05 +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 25SDU0CL2391514; Tue, 28 Jun 2022 09:30:00 -0400 From: Tom Lane To: "James Pang (chaolpan)" cc: "pgsql-performance@lists.postgresql.org" Subject: Re: partition pruning only works for select but update In-reply-to: References: Comments: In-reply-to "James Pang (chaolpan)" message dated "Tue, 28 Jun 2022 13:15:42 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2391512.1656423000.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 28 Jun 2022 09:30:00 -0400 Message-ID: <2391513.1656423000@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "James Pang (chaolpan)" writes: > But when > Explain update table set .. where partitionkey between to_timestamp() = and to_timestamp(); > It still show all of partitions with update ... In releases before v14, partition pruning is far stupider for UPDATE (and DELETE) than it is for SELECT. regards, tom lane