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 1kkaLi-0007l7-4M for pgsql-general@arkaria.postgresql.org; Wed, 02 Dec 2020 22:11:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kkaLh-0004Mu-3W for pgsql-general@arkaria.postgresql.org; Wed, 02 Dec 2020 22:11:45 +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 1kkaLg-0004Mn-Rr for pgsql-general@lists.postgresql.org; Wed, 02 Dec 2020 22:11:44 +0000 Received: from ook.raf.org ([2402:1f00:8100:400::31]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kkaLe-0007Bn-DH for pgsql-general@lists.postgresql.org; Wed, 02 Dec 2020 22:11:44 +0000 Received: from localhost (localhost [127.0.0.1]) by ook.raf.org (Postfix) with ESMTP id B1B0E5DE1E for ; Thu, 3 Dec 2020 09:11:36 +1100 (AEDT) X-Virus-Scanned: Debian amavisd-new at ook.raf.org Received: from ook.raf.org ([127.0.0.1]) by localhost (ook.raf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 930JgY3yC-vy for ; Thu, 3 Dec 2020 09:11:36 +1100 (AEDT) Received: by ook.raf.org (Postfix, from userid 1001) id 500F45E2C6; Thu, 3 Dec 2020 09:11:36 +1100 (AEDT) Date: Thu, 3 Dec 2020 09:11:36 +1100 From: raf To: pgsql-general@lists.postgresql.org Subject: Re: Is the Halloween problem an issue in Postgres Message-ID: <20201202221136.troad5g7gkddpnuk@raf.org> References: <756bd845-ebe1-4c45-88e8-0ab44bbc02b7@Spark> <5f7e3d0e-52da-c5e4-72d6-edcff340d710@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5f7e3d0e-52da-c5e4-72d6-edcff340d710@gmx.net> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Dec 02, 2020 at 11:02:07PM +0100, Thomas Kellerer wrote: > guyren@icloud.com schrieb am 02.12.2020 um 21:27: > > The Halloween problem is that it is a challenge for the database if > > you’re updating a field that is also in the WHERE clause of the same > > query. > > > > I just saw a presentation from someone about how in SQL Server he > > recommended writing changes to a temp table and then writing them to > > the table as being much more efficient. > > It sounds strange to me, that this _is_ actually a problem. > > Why exactly is that a problem in SQL Server? > And what are the consequences if you do it nevertheless. According to wikipedia, this problem was discovered on Halloween day, 1976. I find it hard to believe that any database would still exhibit that behaviour 44 years later. cheers, raf