pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Cache smgrnblocks() results in recovery.
Date: Fri, 31 Jul 2020 02:34:29 +0000
Message-ID: <E1k1KsP-0008PC-Ml@gemulon.postgresql.org> (raw)

Cache smgrnblocks() results in recovery.

Avoid repeatedly calling lseek(SEEK_END) during recovery by caching
the size of each fork.  For now, we can't use the same technique in
other processes, because we lack a shared invalidation mechanism.

Do this by generalizing the pre-existing caching used by FSM and VM
to support all forks.

Discussion: https://postgr.es/m/CAEepm%3D3SSw-Ty1DFcK%3D1rU-K6GSzYzfdD4d%2BZwapdN7dTa6%3DnQ%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c5315f4f44843c20ada876fdb0d0828795dfbdf5

Modified Files
--------------
contrib/pg_visibility/pg_visibility.c     |  2 +-
src/backend/access/heap/visibilitymap.c   | 18 +++++-------
src/backend/catalog/storage.c             |  4 +--
src/backend/storage/freespace/freespace.c | 27 +++++++++--------
src/backend/storage/smgr/smgr.c           | 49 +++++++++++++++++++++++--------
src/include/storage/smgr.h                | 12 ++++----
6 files changed, 66 insertions(+), 46 deletions(-)



Message-ID: <E1k1KsP-0008PC-Ml@gemulon.postgresql.org>
Permalink:  ../E1k1KsP-0008PC-Ml@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1k1KsP-0008PC-Ml@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tmunro@postgresql.org
  Subject: Re: pgsql: Cache smgrnblocks() results in recovery.
  In-Reply-To: <E1k1KsP-0008PC-Ml@gemulon.postgresql.org>
  References: <E1k1KsP-0008PC-Ml@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox