Re: INSERT ... ON CONFLICT DO UPDATE

From: Francisco Olarte <folarte(at)peoplecall(dot)com>
To: Igor Neyman <ineyman(at)perceptron(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, 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:18:34
Message-ID: CA+bJJbw5GL9rdg+ae54nrxpqsBGTht-5=0uh7mRtD8jaRWtUAg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Igor:

On Mon, Jul 20, 2015 at 4:56 PM, Igor Neyman <ineyman(at)perceptron(dot)com> wrote:
> Well, there is a caveat.
> If I create table and couple indexes like this:
..
> and populate them:
> and then check the size of the indexes:
> for "select pg_relation_size('U1')" I get 2834432
> while " select pg_relation_size('U2')" returns 2285568.
> So, index based on randomly populated column is bigger than the one based on sequentially populated.
> But, on the other hand, after:
> reindex table test_index_size;
> both indexes are of the same size: 2260992.

I would totally expect this. On reindex you get the values from a tree
walk, so both of them come in order, and being a reindex ( where you
know in advance the full set of values, so you can plan ahead where to
put the leaves, how many levels you need and how many splits ) you get
an even bigger advantage from the squential insertion case.

Francisco Olarte.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Olarte 2015-07-21 07:21:21 Re: INSERT ... ON CONFLICT DO UPDATE
Previous Message Francisco Olarte 2015-07-21 07:14:35 Re: INSERT ... ON CONFLICT DO UPDATE