Re: Dirty buffers with suppress_redundant_updates_trigger

From: Michael Lewis <mlewis(at)entrata(dot)com>
To: Mike Noordermeer <mike(at)normi(dot)net>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dirty buffers with suppress_redundant_updates_trigger
Date: 2020-09-14 15:35:40
Message-ID: CAHOFxGo6MLYudUrCjit0Hj44PF=gpWTR6hacDYr7vAVqqfRhgw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Just curious, are you doing this in a trigger or in your application code?
Either way, I'd think you could use the table record type to compare the
temp vs real table values as an entire unit.

with cte_indexes as(
select * from pg_indexes limit 10
)
select i1.indexdef, i2.tablename
from cte_indexes AS i1
join cte_indexes AS i2 on i1.indexname = i2.indexname
where
i1 IS DISTINCT FROM i2;

trigger-
https://www.depesz.com/2007/09/08/avoiding-empty-updates/

I would probably delete records in the regular table that do not exist in
the temp table, then delete from the temp table that already exists in the
main table and then update the remaining rows.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2020-09-14 16:03:22 Re: Effective IO Concurrency
Previous Message Mike Noordermeer 2020-09-14 15:12:16 Re: Dirty buffers with suppress_redundant_updates_trigger