Re: Performance question - Mailing list pgsql-general

From Jean-Christian Imbeault
Subject Re: Performance question
Date
Msg-id 3F028234.7070309@mega-bucks.co.jp
Whole thread Raw
In response to Performance question  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
Responses Re: Performance question  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:
>
> Fair enough, it would do that.  But you still need the surrounding retry
> logic to cope when a collision does happen.

Why retry logic? I thought that if there was a collision one of the
insert attempts would necessarily succeed and all the others fails. So
no need for a retry since the record (pk) was inserted.

What I am trying to duplicate is if an inserts into a primary key field
is a duplicate it fails silently. If it isn't or there are multiple
attempts at the same time to insert the *same* new primary key, the new
pk is inserted.

The suggested method does guarantee an insert if it there is a collision
right? If not I need to find a new solution :(

Jean-Christian Imbeault




pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Performance question
Next
From: Tom Lane
Date:
Subject: Re: Still trouble reindexing