On Tue, Apr 10, 2018 at 11:10 AM, Heikki Linnakangas <hlinn...@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.