pgsql: Revert "Avoid the creation of the free space map for smallheap - Mailing list pgsql-committers

From Amit Kapila
Subject pgsql: Revert "Avoid the creation of the free space map for smallheap
Date
Msg-id E1hNrRx-0008JU-UJ@gemulon.postgresql.org
Whole thread Raw
Responses Re: pgsql: Revert "Avoid the creation of the free space map for small heap
List pgsql-committers
Revert "Avoid the creation of the free space map for small heap relations".

This feature was using a process local map to track the first few blocks
in the relation.  The map was reset each time we get the block with enough
freespace.  It was discussed that it would be better to track this map on
a per-relation basis in relcache and then invalidate the same whenever
vacuum frees up some space in the page or when FSM is created.  The new
design would be better both in terms of API design and performance.

List of commits reverted, in reverse chronological order:

06c8a5090e  Improve code comments in b0eaa4c51b.
13e8643bfc  During pg_upgrade, conditionally skip transfer of FSMs.
6f918159a9  Add more tests for FSM.
9c32e4c350  Clear the local map when not used.
29d108cdec  Update the documentation for FSM behavior..
08ecdfe7e5  Make FSM test portable.
b0eaa4c51b  Avoid creation of the free space map for small heap relations.

Discussion: https://postgr.es/m/20190416180452.3pm6uegx54iitbt5@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7db0cde6b58eef2ba0c70437324cbc7622230320

Modified Files
--------------
contrib/pageinspect/expected/page.out     |  64 ++++---
contrib/pageinspect/sql/page.sql          |  34 ++--
contrib/pgstattuple/pgstatapprox.c        |   3 -
doc/src/sgml/pgfreespacemap.sgml          |   2 -
doc/src/sgml/pgstattuple.sgml             |   4 +-
doc/src/sgml/ref/pgupgrade.sgml           |   7 -
doc/src/sgml/storage.sgml                 |  13 +-
src/backend/access/brin/brin.c            |   2 +-
src/backend/access/brin/brin_pageops.c    |  10 +-
src/backend/access/heap/hio.c             |  42 ++---
src/backend/access/heap/vacuumlazy.c      |  17 +-
src/backend/access/transam/xact.c         |  14 --
src/backend/storage/freespace/README      |  38 +---
src/backend/storage/freespace/freespace.c | 301 +-----------------------------
src/backend/storage/freespace/indexfsm.c  |   6 +-
src/bin/pg_upgrade/info.c                 |  16 +-
src/bin/pg_upgrade/pg_upgrade.h           |   6 -
src/bin/pg_upgrade/relfilenode.c          |  63 +------
src/include/storage/freespace.h           |   9 +-
src/test/regress/expected/fsm.out         |  73 --------
src/test/regress/parallel_schedule        |   2 +-
src/test/regress/serial_schedule          |   1 -
src/test/regress/sql/fsm.sql              |  66 -------
23 files changed, 107 insertions(+), 686 deletions(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Remove some code related to 7.3 and older servers from toolsof
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Revert "Avoid the creation of the free space map for small heap