Re: index fragmentation on insert-only table with non-unique column

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: index fragmentation on insert-only table with non-unique column
Date: 2016-05-25 04:43:08
Message-ID: 4117.1464151388@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Peter Geoghegan <pg(at)bowt(dot)ie> writes:
> The basic problem is that the B-Tree code doesn't maintain this
> property. However, B-Tree index builds will create an index that
> initially has this property, because the tuplesort.c code happens to
> sort index tuples with a CTID tie-breaker.

Yeah. I wonder what would happen if we used the same rule for index
insertions. It would likely make insertions more expensive, but maybe
not by much. The existing "randomization" rule for where to insert new
items in a run of identical index entries would go away, because the
insertion point would become deterministic. I am not sure if that's
good or bad for insertion performance, but it would likely help for
scan performance.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Peter Geoghegan 2016-05-25 05:18:06 Re: index fragmentation on insert-only table with non-unique column
Previous Message Stephen Frost 2016-05-25 04:26:25 Re: index fragmentation on insert-only table with non-unique column