Re: Locking B-tree leafs immediately in exclusive mode

From: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
To: Claudio Freire <klaussfreire(at)gmail(dot)com>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Locking B-tree leafs immediately in exclusive mode
Date: 2018-06-14 14:13:14
Message-ID: CAPpHfdufVgOfpG+ZoujrrFQQYMfuJseAC9Ypi7Sp3SjnHvQ+XA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 14, 2018 at 4:56 PM Claudio Freire <klaussfreire(at)gmail(dot)com> wrote:
> Not at all. Insertion cost in unique indexes with lots of duplicates
> (happens, dead duplicates) grows quadratically on the number of
> duplicates, and that's improved by making the index unique and sorted.

Sorry, I've messed up the terms. I did actually compare current
non-unique indexes with non-unique indexes keeping duplicate entries
ordered by TID (which makes them somewhat unique). I didn't really
considered indexes, which forces unique constraints. For them
insertion cost grows quadratically (as you mentioned) independently on
whether we're keeping duplicates ordered by TID or not.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-06-14 14:23:28 Re: Needless additional partition check in INSERT?
Previous Message Claudio Freire 2018-06-14 13:56:17 Re: Locking B-tree leafs immediately in exclusive mode