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 1kG43e-0000I2-0g for pgsql-bugs@arkaria.postgresql.org; Wed, 09 Sep 2020 17:38:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kG43b-0006nV-9f for pgsql-bugs@arkaria.postgresql.org; Wed, 09 Sep 2020 17:38:55 +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 1kG43b-0006nO-3c for pgsql-bugs@lists.postgresql.org; Wed, 09 Sep 2020 17:38:55 +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 1kG43Z-00015B-0B for pgsql-bugs@lists.postgresql.org; Wed, 09 Sep 2020 17:38:54 +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 089HcoNP043787; Wed, 9 Sep 2020 13:38:50 -0400 From: Tom Lane To: stephane.desnault@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16613: Built in suppress_redundant_updates_trigger() trigger not supressing redundant updates In-reply-to: <16613-d5d1f061f4d595d3@postgresql.org> References: <16613-d5d1f061f4d595d3@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Wed, 09 Sep 2020 16:25:00 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <43785.1599673130.1@sss.pgh.pa.us> Date: Wed, 09 Sep 2020 13:38:50 -0400 Message-ID: <43786.1599673130@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > The built-in suppress_redundant_updates_trigger() trigger is not supressing > redundant updates after an ALTER TABLE ... ADD COLUMN... This doesn't seem like a bug. The trigger code is looking for bitwise equality between new tuple and old tuple, which it won't find because the new tuple will have a larger number-of-attributes field; not to mention a possibly-wider nulls bitmap. Sure, we could complicate the trigger to try to understand such cases, but that would likely make things net slower in most applications. The hard part of having such a trigger is that it's pure overhead for real updates, so that overhead has to be minimized. Possibly the documentation could be clarified. What it says now is "prevent any update that does not actually change the data in the row from taking place", which is pretty vague about what the criteria really are. Not sure about better wording though. regards, tom lane