Re: WIP: Avoid creation of the free space map for small tables

From: John Naylor <jcnaylor(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WIP: Avoid creation of the free space map for small tables
Date: 2018-10-07 15:17:24
Views: Raw Message | Whole Thread | Download mbox
Lists: pgsql-hackers

On 10/6/18, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com> wrote:
> On Sat, Oct 6, 2018 at 7:47 AM John Naylor <jcnaylor(at)gmail(dot)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.

-John Naylor

Attachment Content-Type Size
v2-0001-Avoid-creation-of-the-free-space-map-for-small-ta.patch text/x-patch 15.0 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-10-07 15:37:20 Re: Defaulting to password_encryption = scram-sha-256
Previous Message Michael Paquier 2018-10-07 15:09:13 Re: pg_upgrade failed with ERROR: null relpartbound for relation 18159 error.