Re: Faster inserts with mostly-monotonically increasing values

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Simon Riggs <simon(dot)riggs(at)2ndquadrant(dot)com>
Subject: Re: Faster inserts with mostly-monotonically increasing values
Date: 2018-04-10 14:19:00
Message-ID: CAGTBQpbJxLRn4zJpFSQgWBSU=j_01yWDHmZv1EGSfV7=fXqhNw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 10, 2018 at 11:10 AM, Heikki Linnakangas <hlinnaka(at)iki(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavan Deolasee 2018-04-10 14:20:16 Re: Faster inserts with mostly-monotonically increasing values
Previous Message Alvaro Herrera 2018-04-10 14:17:43 Re: [HACKERS] GSoC 2017: Foreign Key Arrays