pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Don't initialize page in {vm,fsm}_extend(), not needed
Date: Wed, 05 Apr 2023 16:21:46 +0000
Message-ID: <E1pk5tJ-001W2q-Bq@gemulon.postgresql.org> (raw)

Don't initialize page in {vm,fsm}_extend(), not needed

The read path needs to be able to initialize pages anyway, as relation
extensions are not durable. By avoiding initializing pages, we can, in a
future patch, extend the relation by multiple blocks at once.

Using smgrextend() for {vm,fsm}_extend() is not a good idea in general, as at
least one page of the VM/FSM will be read immediately after, always causing a
cache miss, requiring us to read content we just wrote.

Discussion: https://postgr.es/m/20230301223515.pucbj7nb54n4i4nv@awork3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3d6a98457d8e21d85bed86cfd3e1d1df1b260721

Modified Files
--------------
src/backend/access/heap/visibilitymap.c   | 6 +-----
src/backend/storage/freespace/freespace.c | 5 +----
2 files changed, 2 insertions(+), 9 deletions(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1pk5tJ-001W2q-Bq@gemulon.postgresql.org>
Permalink:  ../E1pk5tJ-001W2q-Bq@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pk5tJ-001W2q-Bq@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Don't initialize page in {vm,fsm}_extend(), not needed
  In-Reply-To: <E1pk5tJ-001W2q-Bq@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