Re: The Free Space Map: Problems and Opportunities

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Jan Wieck <jan(at)wi3ck(dot)info>, Gregory Smith <gregsmithpgsql(at)gmail(dot)com>, John Naylor <john(dot)naylor(at)enterprisedb(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Subject: Re: The Free Space Map: Problems and Opportunities
Date: 2021-08-20 17:32:33
Message-ID: CAH2-WzmCrM=k9_5ncb+Au+awmM9DnRmHSJ86SYZ1yMgtY08_vw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 20, 2021 at 10:15 AM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> > I guess that's true. Isn't this just semantics, though?
>
> Not entirely. On one level, as long as we end up with an FSM
> implementation that does good things, who cares how it works
> internally?

> I'd say "well, you should try
> to make the replacement data structure as simple as it can be while
> still having the other properties that you care about ... and in
> particular I would suggest something that uses a fixed amount of state
> per heap page, because that seems much simpler to me." But nobody's
> got to agree with that, and it doesn't have to be right. It's just
> what I think.

But not storing information about a heap page implicitly means that
the page is closed. And so we effectively remember the state of every
single heap page with the FSM design I am working on. Not storing any
information in the data structure is just an optimization. In any case
we're obligated to have accurate information about all individual heap
pages.

Doing it that way seems pretty natural to me, even though the overhead
of maintaining the FSM data structure isn't a priority for me -- not
at all. It might actually be easier to have that optimization than to
not have it. The starting point for the new FSM data structure is
lists of blocks that are usable, that have free space. Whereas the
starting point for the existing FSM structure is every single extant
heap page in the table -- it's strictly obligated to have explicit
information about every single page (otherwise we get nasty smgr
errors). It's either a small difference or a big difference, depending
on how you think about it.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shruthi Gowda 2021-08-20 17:36:13 Re: preserving db/ts/relfilenode OIDs across pg_upgrade (was Re: storing an explicit nonce)
Previous Message Bossart, Nathan 2021-08-20 17:29:22 Re: archive status ".ready" files may be created too early