Re: Insert vs Update - Mailing list pgsql-performance

From David G. Johnston
Subject Re: Insert vs Update
Date
Msg-id CAKFQuwbrSvT=AhsajQs1GM7D4_TudduztzVmovdw2_Dj94iaPw@mail.gmail.com
Whole thread Raw
In response to Re: Insert vs Update  (Robert DiFalco <robert.difalco@gmail.com>)
Responses Re: Insert vs Update
List pgsql-performance
On Wed, Jul 15, 2015 at 3:16 PM, Robert DiFalco <robert.difalco@gmail.com> wrote:
The different event types have differing amounts of related data. 

​On this basis alone I would select the multiple-table version as my baseline and only consider something different if the performance of this was insufficient and I could prove that an alternative arrangement was more performant.

A single optional date with meta-data embedded in the column name​
 
​is usually workable but if you then have a bunch of other columns with name like:

preparation_date, preparation_col1, preparation_col2, consumed_col1, consumed_col2, consumed_date

​I would find that to be undesirable.

You may be able to put Table Inheritance to good use here...

I do not know (but doubt) if HOT optimization works when going from NULL to non-NULL since the former is stored in a bitmap while the later occupies normal relation space and thus the update would likely end up writing an entirely new​ record upon each event category recording.

David J.


pgsql-performance by date:

Previous
From: Robert DiFalco
Date:
Subject: Re: Insert vs Update
Next
From: Robert DiFalco
Date:
Subject: Re: Insert vs Update