pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Transactions, tuples, and VACUUM
2+ messages / 2 participants
[nested] [flat]

* Transactions, tuples, and VACUUM
@ 2003-08-14 10:01  Matt Clark <matt@ymogen.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Matt Clark @ 2003-08-14 10:01 UTC (permalink / raw)
  To: pgsql-admin

Morning all, bit of a general question here...

consider:

  begin;
  update a set col1 = 'p' where id = '1';
  update a set col2 = 'q' where id = '1';
  commit;

versus:

  update a set col1 = 'p', col2 = 'q' where id = '1';

Does the first case generate any more dead tuples that will need vacuuming than the second case, or are the two updates 'merged'
when the transaction is committed?  Or is the answer 'sometimes' (I would guess depending on checkpoints)?

Cheers

Matt








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

* Re: Transactions, tuples, and VACUUM
@ 2003-08-14 11:38  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Matt Clark <matt@ymogen.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2003-08-14 11:38 UTC (permalink / raw)
  To: Matt Clark <matt@ymogen.net>; +Cc: pgsql-admin

"Matt Clark" <matt@ymogen.net> writes:
> consider:
>   begin;
>   update a set col1 = 'p' where id = '1';
>   update a set col2 = 'q' where id = '1';
>   commit;
> versus:
>   update a set col1 = 'p', col2 = 'q' where id = '1';

> Does the first case generate any more dead tuples that will need
> vacuuming than the second case,

Yes.  Takes twice as long, too.

			regards, tom lane



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


end of thread, other threads:[~2003-08-14 11:38 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-08-14 10:01 Transactions, tuples, and VACUUM Matt Clark <matt@ymogen.net>
2003-08-14 11:38 ` Tom Lane <tgl@sss.pgh.pa.us>

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