X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 3E889D1B4BC for ; Fri, 19 Mar 2004 07:14:42 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 82905-01 for ; Fri, 19 Mar 2004 03:14:40 -0400 (AST) Received: from localhost.localdomain (unknown [166.70.154.50]) by svr1.postgresql.org (Postfix) with ESMTP id A6F53D1B4A7 for ; Fri, 19 Mar 2004 03:14:38 -0400 (AST) Received: from [127.0.0.1] (strongbad [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id i2J7ETBo030293; Fri, 19 Mar 2004 00:14:30 -0700 In-Reply-To: <200403190927.43971.sad@bankir.ru> References: <200403180941.45591.sad@bankir.ru> <200403181038.30116.josh@agliodbs.com> <200403190927.43971.sad@bankir.ru> Mime-Version: 1.0 (Apple Message framework v613) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <101F118F-7975-11D8-B40E-000A959D1424@intercation.com> Content-Transfer-Encoding: 7bit Cc: pgsql-sql@postgresql.org From: Adam Ruth Subject: Re: perfomance question Date: Fri, 19 Mar 2004 00:14:29 -0700 To: sad X-Mailer: Apple Mail (2.613) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/197 X-Sequence-Number: 17296 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 >