Re: INSERT ... ON CONFLICT {UPDATE | IGNORE} 2.0

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Andres Freund <andres(at)2ndquadrant(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Thom Brown <thom(at)linux(dot)com>
Subject: Re: INSERT ... ON CONFLICT {UPDATE | IGNORE} 2.0
Date: 2015-03-02 20:15:22
Message-ID: 54F4C4DA.10300@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03/02/2015 09:29 PM, Peter Geoghegan wrote:
> On Mon, Mar 2, 2015 at 11:20 AM, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
>> Are we OK with a 10% overhead, caused by the locking? That's probably
>> acceptable if that's what it takes to get UPSERT. But it's not OK just to
>> solve the deadlock issue with regular insertions into a table with exclusion
>> constraints. Can we find a scheme to eliminate that overhead?
>
> Looks like you tested a B-Tree index here. That doesn't seem
> particularly representative of what you'd see with exclusion
> constraints.

Hmm. I used a b-tree to estimate the effect that the locking would have
in the UPSERT case, for UPSERT into a table with a b-tree index. But
you're right that for the question of whether this is acceptable for the
case of regular insert into a table with exclusion constraints, other
indexams are more interesting. In a very quick test, the overhead with a
single GiST index seems to be about 5%. IMHO that's still a noticeable
slowdown, so let's try to find a way to eliminate it.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rahila Syed 2015-03-02 20:17:50 Re: [REVIEW] Re: Compression of full-page-writes
Previous Message Alvaro Herrera 2015-03-02 20:15:14 Re: 32bit OID wrap around concerns