List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:May 11 1999 5:33pm
Subject:Timestamp update question
View as plain text  
>>>>> "Kelly" == Kelly Yancey <kbyanc@stripped> writes:

Kelly>   I recall reading a week or so ago on this list that if you wanted to
Kelly> update a table but not update the first timestamp value, the solution was
Kelly> to simply set the field equal to itself as part of the update.
Kelly>   This makes sense, however I'm curious as to the efficiency of this
Kelly> approach?

Kelly>   Does mysql realize the value isn't changing and not update the field at
Kelly> all (like it optimizes other UPDATEs). Or does it first update the
Kelly> timestamp like it does normally and then set it to the original value (I
Kelly> have trouble seeing the latter happening).

Kelly>   Needless to say, I'm hoping it is the first because then we know there
Kelly> is no overhead in not updating a timestamp field (other than the miniscule
Kelly> amount required to process the additional field in the UPDATE query).

Hi!

In the case of:

SET timestamp_colum=timestamp_column

You will only loose a memcpy() of size of the timestamp column (4
bytes) + some setup.  I don't think you will notice this...

Regards,
Monty

Thread
Timestamp update questionKelly Yancey11 May
  • Timestamp update questionMichael Widenius11 May
    • Re: Timestamp update questionKelly Yancey11 May
      • Re: Timestamp update questionMichael Widenius12 May