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



---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

Reply via email to