Thread: perfomance question

perfomance question

From
sad
Date:
hello.

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';
?



Re: perfomance question

From
Josh Berkus
Date:
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?

-- 
-Josh BerkusAglio Database SolutionsSan Francisco



Re: perfomance question

From
sad
Date:
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 ?)




Re: perfomance question

From
Adam Ruth
Date:
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
>