Re: Function Question - Inserting into a table with foreign constraints - Mailing list pgsql-general

From David Johnston
Subject Re: Function Question - Inserting into a table with foreign constraints
Date
Msg-id FFE71119-4063-4D2B-9440-61FAA82F1898@yahoo.com
Whole thread Raw
In response to Re: Function Question - Inserting into a table with foreign constraints  (Brandon Phelps <bphelps@gls.com>)
List pgsql-general
On Nov 5, 2011, at 10:46, Brandon Phelps <bphelps@gls.com> wrote:

> On 11/5/2011 10:35 AM, Raymond O'Donnell wrote:
>> On 05/11/2011 04:34, Brandon Phelps wrote
>
> With the method you outlined will I notice any huge performance impacts?  The application would be parsing incoming
datafrom another 3rd party application and could, at times, be executing the function in very fast succession, although
nevertwice at the exact same moment (single threaded application, pending events will just block until they're up). 
>
> Thanks again!
>

You would probably be much better off importing the third-party data into a staging table, performing all of your "key"
creation,and then inserting the data into your final tables. 

While triggers would work you end up with a lot of pointless effort when in most cases keys are likely to exist.

David J.

pgsql-general by date:

Previous
From: Brandon Phelps
Date:
Subject: Re: Function Question - Inserting into a table with foreign constraints
Next
From: Stuart Bishop
Date:
Subject: Re: Excessive planner time for some queries with high statistics