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

From Claudio Freire
Subject Re: Faster inserts with mostly-monotonically increasing values
Date
Msg-id CAGTBQpbJxLRn4zJpFSQgWBSU=j_01yWDHmZv1EGSfV7=fXqhNw@mail.gmail.com
Whole thread Raw
In response to Re: Faster inserts with mostly-monotonically increasing values  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: Faster inserts with mostly-monotonically increasing values  (Pavan Deolasee <pavan.deolasee@gmail.com>)
List pgsql-hackers
On Tue, Apr 10, 2018 at 11:10 AM, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
>>                 /* XLOG stuff */
>>                 if (RelationNeedsWAL(rel))
>>                 {
>>                         ...
>>
>>                         if (P_ISLEAF(lpageop))
>>                         {
>>                                 xlinfo = XLOG_BTREE_INSERT_LEAF;
>>
>>                                 /*
>>                                  * Cache the block information if we just
>> inserted into the
>>                                  * rightmost leaf page of the index.
>>                                  */
>>                                 if (P_RIGHTMOST(lpageop))
>>                                         RelationSetTargetBlock(rel,
>> BufferGetBlockNumber(buf));
>>                         }
>>                         ...
>
>
>
> Why is this RelationSetTargetBlock() call inside the "XLOG stuff" block?
> ISTM that we're failing to take advantage of this optimization for unlogged
> tables, for no particular reason. Just an oversight?
>
> - Heikki

Indeed.

Maybe Pavan knows of one, but I don't see any reason not to apply this
to unlogged tables as well. It slipped the review.


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] GSoC 2017: Foreign Key Arrays
Next
From: Pavan Deolasee
Date:
Subject: Re: Faster inserts with mostly-monotonically increasing values