Re: Constant time insertion into highly non-unique indexes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Constant time insertion into highly non-unique indexes
Date: 2005-04-14 15:15:09
Message-ID: 881.1113491709@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
> The move right only occurs when the page is full, so the chance of
> moving right is not 0.99^250, but 0.99, since the previous 249 inserts
> would not cause a page split.

Sure, but given that we have a full page, the probability that 250
successive insertions *all* decide to move right rather than split
that page is 0.99^250. And it only takes one decision to split to
maintain the constant-time behavior. So I still think your analysis
is incorrect.

> IMHO the performance figures show this to be true.

*What* performance figures? You have shown none. We did do performance
testing of this algorithm when we adopted it, and it worked fine ---
though as I say, I don't think we tested with any very wide keys.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Treat 2005-04-14 15:54:56 Re: Interactive docs idea
Previous Message Simon Riggs 2005-04-14 15:05:31 Re: Constant time insertion into highly non-unique