On Mar 18, 2004, at 11:27 PM, sad wrote:
On Thursday 18 March 2004 21:38, you wrote:Sad,
what are perfomance difference bitween a) update t1 set f1 = 'x', f2 = 'y'; b) update t1 set f1 = 'x', f2 = f2; c) update t1 set f1 = 'x'; ?
Not a lot. Why don't you try it?
Really ! why ? :-)
I forgot to ask the second question: How these updates affect a data storage ? (does (b) cause physical update of f2 ?)
Updates always apply to full rows at a time. So while "update t1 set f1 = 'x'" only changes the value of f1 to 'x', f2 will have a second copy with the same value in the new row that is created as part of the update. It's all part of the MVCC architecture. There may be some uncommon exceptions to this rule, but I'm not sure.
Adam Ruth
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match