minimal update - Mailing list pgsql-hackers

From Andrew Dunstan
Subject minimal update
Date
Msg-id 472B4712.3060704@dunslane.net
Whole thread Raw
Responses Re: minimal update  (David Fetter <david@fetter.org>)
Re: minimal update  (Decibel! <decibel@decibel.org>)
List pgsql-hackers
For some time I have been working on removing some inefficiencies from a 
large DW-type app. This app does a large daily batch update, and this is 
what is the major bottleneck. One of the things I have been doing is to 
remove unnecessary updates (which are particualrly expensive in our 
index-rich setting).  Several times now I have wished that there was a 
switch on the UPDATE command that said "do minimal instead of maximal 
updating". i.e., don't update records with identical replacements. At 
the moment I have to write things like:
   update tname set foo = bar ... where foo is null or foo <> bar ...

This becomes more than tedious when the update might be setting thirty 
or forty fields, and I have to write such tests for each of them. It 
would be so much nicer to be able to write something like:
   update tname minimally set foo = bar ...

Is this an insane idea, or would it be possible, practical and useful?

cheers

andrew




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Intel x64 vs AMD x64 pgdata
Next
From: "Gokulakannan Somasundaram"
Date:
Subject: Re: Clarification about HOT