From: Adam Ruth <aruth@intercation.com>
To: sad <sad@bankir.ru>
Cc: pgsql-sql@postgresql.org
Subject: Re: perfomance question
Date: Fri, 19 Mar 2004 00:14:29 -0700
Message-ID: <101F118F-7975-11D8-B40E-000A959D1424@intercation.com> (raw)
In-Reply-To: <200403190927.43971.sad@bankir.ru>
References: <200403180941.45591.sad@bankir.ru>
<200403181038.30116.josh@agliodbs.com>
<200403190927.43971.sad@bankir.ru>
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
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: aruth@intercation.com, sad@bankir.ru
Subject: Re: perfomance question
In-Reply-To: <101F118F-7975-11D8-B40E-000A959D1424@intercation.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox