Re: INSERT ... ON CONFLICT DO UPDATE

From: Francisco Olarte <folarte(at)peoplecall(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: INSERT ... ON CONFLICT DO UPDATE
Date: 2015-07-21 07:14:35
Message-ID: CA+bJJbxFSJfi-QuP6VyBx6m1SD7ac2ZaxM+gKTWz1hxaBe9hFg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Alvaro.

On Mon, Jul 20, 2015 at 4:07 PM, Alvaro Herrera
<alvherre(at)2ndquadrant(dot)com> wrote:
>> Some web research suggests that random sequences are not great for indexes
>> because of the resultant "keyspace fragmentation". I'm assuming that means
>> a low number of nodes in the btree leafs, so an increase in memory usage
>> for the index?
> Not sure what type of indexes would be affected by that problem, but I
> don't think Postgres' btrees would be.

I do not know if postgres btrees do it, but I know you can build btree
inserting code in such a way that inserting nodes sequentially leads
to optimally filled leaf pages an denser trees, as an optimization for
an easy and common case, which are better than the normal ones
generated by random insertion. So is not that random are bad, it is
that ordered are very good, or in another way thay are not affected by
a problem, but do not get the advantage.

Francisco Olarte.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Olarte 2015-07-21 07:18:34 Re: INSERT ... ON CONFLICT DO UPDATE
Previous Message Jeff Janes 2015-07-20 17:18:24 Re: INSERT ... ON CONFLICT DO UPDATE