Re: Constant time insertion into highly non-unique indexes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Constant time insertion into highly non-unique indexes
Date
Msg-id 881.1113491709@sss.pgh.pa.us
Whole thread Raw
In response to Re: Constant time insertion into highly non-unique  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Constant time insertion into highly non-unique  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
Simon Riggs <simon@2ndquadrant.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


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Constant time insertion into highly non-unique
Next
From: Robert Treat
Date:
Subject: Re: Interactive docs idea