performance of updates

From: Ed Prochak <>
Date: Thu, 18 Dec 2008 06:53:36 -0800 (PST)
Message-ID: <>

I am in the midst of some performance improvements. I have never thought about this aspect before but has anyone tested the difference in performance between

UPDATE mytable SET
 status = new_status
WHERE mykey = thiskey;


UPDATE mytable SET
 status = new_status
WHERE mykey = thiskey
  AND status <> new_status;


I haven't run my own test yet. The actual UPDATE is in a trigger but I don't think that matters. The argument a coworker is making is that we should update only if it makes a difference (ie if the value changed). Since this is an update to one row, I'm not sure if the overhead of checking additional columns is worth the minimal savings of avoiding writing the data.

The difference seems to me like it would be minimal. Anyone have evidence either way?

  Ed Received on Thu Dec 18 2008 - 08:53:36 CST

Original text of this message