pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
perfomance question
4+ messages / 3 participants
[nested] [flat]

* perfomance question
@ 2004-03-18 06:41 sad <sad@bankir.ru>
  2004-03-18 18:38 ` Re: perfomance question Josh Berkus <josh@agliodbs.com>
  0 siblings, 1 reply; 4+ messages in thread

From: sad @ 2004-03-18 06:41 UTC (permalink / raw)
  To: pgsql-sql

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




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: perfomance question
  2004-03-18 06:41 perfomance question sad <sad@bankir.ru>
@ 2004-03-18 18:38 ` Josh Berkus <josh@agliodbs.com>
  2004-03-19 06:27   ` Re: perfomance question sad <sad@bankir.ru>
  0 siblings, 1 reply; 4+ messages in thread

From: Josh Berkus @ 2004-03-18 18:38 UTC (permalink / raw)
  To: sad <sad@bankir.ru>; pgsql-sql

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 Berkus
 Aglio Database Solutions
 San Francisco




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: perfomance question
  2004-03-18 06:41 perfomance question sad <sad@bankir.ru>
  2004-03-18 18:38 ` Re: perfomance question Josh Berkus <josh@agliodbs.com>
@ 2004-03-19 06:27   ` sad <sad@bankir.ru>
  2004-03-19 07:14     ` Re: perfomance question Adam Ruth <aruth@intercation.com>
  0 siblings, 1 reply; 4+ messages in thread

From: sad @ 2004-03-19 06:27 UTC (permalink / raw)
  To: pgsql-sql

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 ?)





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: perfomance question
  2004-03-18 06:41 perfomance question sad <sad@bankir.ru>
  2004-03-18 18:38 ` Re: perfomance question Josh Berkus <josh@agliodbs.com>
  2004-03-19 06:27   ` Re: perfomance question sad <sad@bankir.ru>
@ 2004-03-19 07:14     ` Adam Ruth <aruth@intercation.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Adam Ruth @ 2004-03-19 07:14 UTC (permalink / raw)
  To: sad <sad@bankir.ru>; +Cc: 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
>




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2004-03-19 07:14 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-03-18 06:41 perfomance question sad <sad@bankir.ru>
2004-03-18 18:38 ` Josh Berkus <josh@agliodbs.com>
2004-03-19 06:27   ` sad <sad@bankir.ru>
2004-03-19 07:14     ` Adam Ruth <aruth@intercation.com>

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