diff options
author | Amit Kapila <akapila@postgresql.org> | 2019-05-07 09:30:24 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2019-05-07 09:30:24 +0530 |
commit | 7db0cde6b58eef2ba0c70437324cbc7622230320 (patch) | |
tree | 51c6e3fc7db7d2f9e140e30116d09f24042073e2 /doc/src | |
parent | af82f95abb23a56d18fd009ef9eca68ef803a041 (diff) | |
download | postgresql-7db0cde6b58eef2ba0c70437324cbc7622230320.tar.gz postgresql-7db0cde6b58eef2ba0c70437324cbc7622230320.zip |
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
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/pgfreespacemap.sgml | 2 | ||||
-rw-r--r-- | doc/src/sgml/pgstattuple.sgml | 4 | ||||
-rw-r--r-- | doc/src/sgml/ref/pgupgrade.sgml | 7 | ||||
-rw-r--r-- | doc/src/sgml/storage.sgml | 13 |
4 files changed, 7 insertions, 19 deletions
diff --git a/doc/src/sgml/pgfreespacemap.sgml b/doc/src/sgml/pgfreespacemap.sgml index 0bcf79b02b4..0122d278e39 100644 --- a/doc/src/sgml/pgfreespacemap.sgml +++ b/doc/src/sgml/pgfreespacemap.sgml @@ -61,8 +61,6 @@ The values stored in the free space map are not exact. They're rounded to precision of 1/256th of <symbol>BLCKSZ</symbol> (32 bytes with default <symbol>BLCKSZ</symbol>), and they're not kept fully up-to-date as tuples are inserted and updated. - In addition, small tables don't have a free space map, so these functions - will return zero even if free space is available. </para> <para> diff --git a/doc/src/sgml/pgstattuple.sgml b/doc/src/sgml/pgstattuple.sgml index 8797131c643..b17b3c59e0d 100644 --- a/doc/src/sgml/pgstattuple.sgml +++ b/doc/src/sgml/pgstattuple.sgml @@ -527,9 +527,7 @@ approx_free_percent | 2.09 bit set, then it is assumed to contain no dead tuples). For such pages, it derives the free space value from the free space map, and assumes that the rest of the space on the page is taken up by live - tuples. Small tables don't have a free space map, so in that case - this function will report zero free space, likewise inflating the - approximate tuple length. + tuples. </para> <para> diff --git a/doc/src/sgml/ref/pgupgrade.sgml b/doc/src/sgml/ref/pgupgrade.sgml index 26e3f9ea2b9..82886760f10 100644 --- a/doc/src/sgml/ref/pgupgrade.sgml +++ b/doc/src/sgml/ref/pgupgrade.sgml @@ -812,13 +812,6 @@ psql --username=postgres --file=script.sql postgres is down. </para> - <para> - In <productname>PostgreSQL</productname> 12 and later small tables by - default don't have a free space map, as a space optimization. If you are - upgrading a pre-12 cluster, the free space maps of small tables will - likewise not be transferred to the new cluster. - </para> - </refsect1> <refsect1> diff --git a/doc/src/sgml/storage.sgml b/doc/src/sgml/storage.sgml index e0915b6fa01..4285b0a157d 100644 --- a/doc/src/sgml/storage.sgml +++ b/doc/src/sgml/storage.sgml @@ -598,13 +598,12 @@ tuple would otherwise be too big. <indexterm><primary>FSM</primary><see>Free Space Map</see></indexterm> <para> -Each heap relation, unless it is very small, and each index relation, except -for hash indexes, has a Free Space Map (FSM) to keep track of available -space in the relation. It's stored alongside the main relation data in a -separate relation fork, named after the filenode number of the relation, plus -a <literal>_fsm</literal> suffix. For example, if the filenode of a relation -is 12345, the FSM is stored in a file called <filename>12345_fsm</filename>, -in the same directory as the main relation file. +Each heap and index relation, except for hash indexes, has a Free Space Map +(FSM) to keep track of available space in the relation. It's stored +alongside the main relation data in a separate relation fork, named after the +filenode number of the relation, plus a <literal>_fsm</literal> suffix. For example, +if the filenode of a relation is 12345, the FSM is stored in a file called +<filename>12345_fsm</filename>, in the same directory as the main relation file. </para> <para> |