Re: How to avoid UPDATE performance degradation in a transaction

From: Michael Lewis <mlewis(at)entrata(dot)com>
To: Karl Düüna <karl(dot)dyyna(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pgsql Performance <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: How to avoid UPDATE performance degradation in a transaction
Date: 2020-02-14 17:54:29
Message-ID: CAHOFxGpdHR5XaNmuRczmkGUnWop5uVdURuvVs0HBoi3Nrusi6g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

If your trigger is supposed to change certain fields, you could return OLD
instead of NEW if those fields have not been changed by the trigger. You
could also check an updated_on timestamp field to verify if the row has
already been modified and potentially skip the trigger altogether. Just a
couple thoughts to avoid the bloat.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message MingJu Wu 2020-02-15 11:04:48 Partial index creation always scans the entire table
Previous Message Karl Düüna 2020-02-14 07:14:57 Re: How to avoid UPDATE performance degradation in a transaction