Re: Refactoring speculative insertion with unique indexes a little

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: hlinnaka <hlinnaka(at)iki(dot)fi>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Refactoring speculative insertion with unique indexes a little
Date: 2015-07-02 17:49:03
Message-ID: CAM3SWZQ50FfYX9ru=qUfPMSZfnvV+sEQDJBJc-Zo74-ED7+U-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 2, 2015 at 1:30 AM, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
>> Sure, if a speculative inserter detects a conflict, it still has to
>> wait. But not in the aminsert call, and not until it cleans up its
>> physical insertion (by super-deleting). Clearly a
>> CHECK_UNIQUE_SPECULATIVE would have to be much closer to
>> CHECK_UNIQUE_PARTIAL than to CHECK_UNIQUE_YES.
>
>
> Why is it not OK for aminsert to do the waiting, with
> CHECK_UNIQUE_SPECULATIVE?

Well, waiting means getting a ShareLock on the other session's XID.
You can't do that without first releasing your locks, unless you're
okay with unprincipled deadlocks.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-07-02 17:58:45 Re: Rework the way multixact truncations work
Previous Message Heikki Linnakangas 2015-07-02 17:31:39 Re: Configurable location for extension .control files