Re: About updates

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: About updates
Date: 2006-03-10 16:08:48
Message-ID: 20060310160848.GA21806@webserv.wug-glas.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

am 10.03.2006, um 10:46:39 -0500 mailte Emi Lu folgendes:
> Hello,
>
> postgresql 8.0.1, in a plpgsql function
>
> To update columns' values in a table (without OID), if I ran:
> 1. "update table1 set col1 = ..., col2 = ... ... col100 ="
>
> or
> 2.
> "update table1 set col1 = "
> ...
> "update table1 set col100 = "
>
> way 1 only has one disk I/O, right? While way 2 is more time consuming
> since there is disk I/O when a update is ran.

Because of MVCC every UPDATE is practical a DELETE + INSERT.
Way1: you have only one DELETE+INSERT, Way2 one hundred, and you have
100 dead rows until the next VACUUM.

HTH, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47215, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Emi Lu 2006-03-10 16:13:43 Re: About updates
Previous Message Emi Lu 2006-03-10 16:06:04 Re: in Pl/PgSQL, do commit every 5000 records