/* 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

Reply via email to