Re: Insert vs Update - Mailing list pgsql-performance

From Michael Nolan
Subject Re: Insert vs Update
Date
Msg-id CAOzAqu+UqrDXAqveH_PoK=6P2t28m3MSbem7ru0i5hoaACv5vw@mail.gmail.com
Whole thread Raw
In response to Re: Insert vs Update  (Robert DiFalco <robert.difalco@gmail.com>)
Responses Re: Insert vs Update  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-performance


On Wed, Jul 15, 2015 at 3:16 PM, Robert DiFalco <robert.difalco@gmail.com> wrote:

Thanks David, my example was a big simplification, but I appreciate your guidance. The different event types have differing amounts of related data. Query speed on this schema is not important, it's really the write speed that matters. So I was just wondering given the INSERT or UPDATE approach (with no indexed data being changed) if one is likely to be substantially faster than the other. 


As I understand how ACID compliance is done, updating a record will require updating any indexes for that record, even if the index keys are not changing.  That's because any pending transactions still need to be able to find the 'old' data, while new transactions need to be able to find the 'new' data.  And ACID also means an update is essentially a delete-and-insert. 
--
Mike Nolan

pgsql-performance by date:

Previous
From: Robert DiFalco
Date:
Subject: Re: Insert vs Update
Next
From: "David G. Johnston"
Date:
Subject: Re: Insert vs Update