Re: Performance UPDATE/INSERT

From: Alban Hertroys <alban(at)magproductions(dot)nl>
To: MG <pgsql-general(at)carladata(dot)de>
Cc: Thomas Pundt <thomas(dot)pundt(at)rp-online(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: Performance UPDATE/INSERT
Date: 2006-04-11 10:15:41
Message-ID: 443B81CD.8060902@magproductions.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

MG wrote:
> I have to improve the performance of the UPDATES and I was wondering why
> the UPDATEs need twice as long as the INSERTs.

IIRC, an UPDATE is a DELETE/INSERT combo. That's because the original
record still needs to be visible to other existing transactions (because
of MVCC). You can't change its data but need to create a new record
instead and mark the original as obsolete.

--
Alban Hertroys
alban(at)magproductions(dot)nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
7500 AK Enschede

// Integrate Your World //

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2006-04-11 10:19:57 Re: trigger firing order
Previous Message Alban Hertroys 2006-04-11 10:08:41 Re: pg_restore 7.4.7 locks itself out