Re: WIP: Avoid creation of the free space map for small tables
John Naylor <jcnaylor@gmail.com>
From: John Naylor <jcnaylor@gmail.com>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2018-10-07T15:17:24Z
Lists: pgsql-hackers
Attachments
- v2-0001-Avoid-creation-of-the-free-space-map-for-small-ta.patch (text/x-patch) patch v2-0001
On 10/6/18, Thomas Munro <thomas.munro@enterprisedb.com> wrote: > On Sat, Oct 6, 2018 at 7:47 AM John Naylor <jcnaylor@gmail.com> wrote: >> A while back, Robert Haas noticed that the space taken up by very >> small tables is dominated by the FSM [1]. Tom suggested that we could >> prevent creation of the FSM until the heap has reached a certain >> threshold size [2]. Attached is a WIP patch to implement that. I've >> also attached a SQL script to demonstrate the change in behavior for >> various scenarios. > > Hi John, > > You'll need to tweak the test in contrib/pageinspect/sql/page.sql, > because it's currently asserting that there is an FSM on a small table > so make check-world fails. Whoops, sorry about that; the attached patch passes make check-world. While looking into that, I also found a regression: If the cached target block is the last block in the relation and there is no free space, that block will be tried twice. That's been fixed as well. Thanks, -John Naylor
Commits
-
Improve code comments in b0eaa4c51b.
- 06c8a5090ed9 12.0 landed
-
During pg_upgrade, conditionally skip transfer of FSMs.
- 13e8643bfc29 12.0 landed
-
Add more tests for FSM.
- 6f918159a97a 12.0 landed
-
Doc: Update the documentation for FSM behavior for small tables.
- 29d108cdecbe 12.0 landed
-
Make FSM test portable.
- 08ecdfe7e5e0 12.0 landed
-
Avoid creation of the free space map for small heap relations, take 2.
- b0eaa4c51bbf 12.0 landed
-
Move page initialization from RelationAddExtraBlocks() to use, take 2.
- 0d1fe9f74e36 12.0 cited
-
Avoid creation of the free space map for small heap relations.
- ac88d2962a96 12.0 landed
-
In bootstrap mode, don't allow the creation of files if they don't already
- d66e3664b8ba 12.0 landed