Re: perfomance question - Mailing list pgsql-sql

From Adam Ruth
Subject Re: perfomance question
Date
Msg-id 101F118F-7975-11D8-B40E-000A959D1424@intercation.com
Whole thread Raw
In response to Re: perfomance question  (sad <sad@bankir.ru>)
List pgsql-sql
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
>



pgsql-sql by date:

Previous
From: sad
Date:
Subject: Re: perfomance question
Next
From: Martin Marques
Date:
Subject: inverse of "day of year"