Re: Faster inserts with mostly-monotonically increasing values - Mailing list pgsql-hackers

From Pavan Deolasee
Subject Re: Faster inserts with mostly-monotonically increasing values
Date
Msg-id CABOikdNoB5rRac8AgEkVKzCQVUPx+yW96w3x=8KyqbxL2rVg1A@mail.gmail.com
Whole thread Raw
In response to Re: Faster inserts with mostly-monotonically increasing values  (Claudio Freire <klaussfreire@gmail.com>)
Responses Re: Faster inserts with mostly-monotonically increasing values  (Claudio Freire <klaussfreire@gmail.com>)
List pgsql-hackers


On Sat, Mar 10, 2018 at 12:11 AM, Claudio Freire <klaussfreire@gmail.com> wrote:
On Fri, Mar 9, 2018 at 2:54 PM, Pavan Deolasee <pavan.deolasee@gmail.com> wrote:
>
>

>
> So yes, the benefits of the patch go down with higher number of clients, but
> it does not entirely vanish.

What if you implement my suggestion?

That should improve the multi-client case considerably.


Yes, I will try that next - it seems like a good idea. So the idea would be: check if the block is still the rightmost block and the insertion-key is greater than the first key in the page. If those conditions are satisfied, then we do a regular binary search within the page to find the correct location. This might add an overhead of binary search when keys are strictly ordered and a single client is inserting the data. If that becomes a concern, we might be able to look for that special case too and optimise for it too.

Thanks,
Pavan

--
 Pavan Deolasee                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

pgsql-hackers by date:

Previous
From: Pavan Deolasee
Date:
Subject: Re: [HACKERS] MERGE SQL Statement for PG11
Next
From: Peter Geoghegan
Date:
Subject: Re: [HACKERS] MERGE SQL Statement for PG11