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 1kkZ2r-0004fb-Ip for pgsql-general@arkaria.postgresql.org; Wed, 02 Dec 2020 20:48:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kkZ2q-00039e-H7 for pgsql-general@arkaria.postgresql.org; Wed, 02 Dec 2020 20:48:12 +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 1kkZ2q-00039V-8e for pgsql-general@lists.postgresql.org; Wed, 02 Dec 2020 20:48:12 +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 1kkZ2o-00057R-3m for pgsql-general@postgresql.org; Wed, 02 Dec 2020 20:48:11 +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 0B2Km59C1673520; Wed, 2 Dec 2020 15:48:05 -0500 From: Tom Lane To: guyren@icloud.com cc: PG-General Mailing List Subject: Re: Is the Halloween problem an issue in Postgres In-reply-to: <756bd845-ebe1-4c45-88e8-0ab44bbc02b7@Spark> References: <756bd845-ebe1-4c45-88e8-0ab44bbc02b7@Spark> Comments: In-reply-to guyren@icloud.com message dated "Wed, 02 Dec 2020 12:27:16 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1673518.1606942085.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2020 15:48:05 -0500 Message-ID: <1673519.1606942085@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk guyren@icloud.com writes: > The Halloween problem is that it is a challenge for the database if you=E2= =80=99re updating a field that is also in the WHERE clause of the same que= ry. > I just saw a presentation from someone about how in SQL Server he recomm= ended writing changes to a temp table and then writing them to the table a= s being much more efficient. That's nonsense as far as Postgres is concerned. regards, tom lane