Re: perfomance question

From: Adam Ruth <aruth(at)intercation(dot)com>
To: sad <sad(at)bankir(dot)ru>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: perfomance question
Date: 2004-03-19 07:14:29
Message-ID: 101F118F-7975-11D8-B40E-000A959D1424@intercation.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Martin Marques 2004-03-19 12:06:17 inverse of "day of year"
Previous Message sad 2004-03-19 06:27:43 Re: perfomance question