Re: Faster inserts with mostly-monotonically increasing values

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: Claudio Freire <klaussfreire(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:10:26
Message-ID: 16816f20-db29-f280-1830-7580885684b2@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Rofail 2018-04-10 14:10:57 Re: [HACKERS] GSoC 2017: Foreign Key Arrays
Previous Message Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?= 2018-04-10 14:07:26 Re: Transform for pl/perl