Re: relpages in pg_class

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: relpages in pg_class
Дата
Msg-id CAH2-Wz=xFBK69PiXo8aFQhDYvKqVtaVTQfS+LD1aAtacbPfh=w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: relpages in pg_class  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: relpages in pg_class  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-docs
On Fri, Aug 19, 2022 at 9:40 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Yeah, we use "blocks" and "pages" interchangeably, which is something
> I don't feel a need to change; but evidently the OP didn't realize that.
> This is a job for the glossary, perhaps?

I think that they're synonyms that can often (but not always) be used
interchangeably. I *think* that this understanding is shared by other
people, though I should check. Here goes:

To me, "block" emphasizes on-disk/relfilenode storage. Something that
exists at a particular physical offset in a particular file (a
BlockNumber + relfilenode). On the other hand, the term "page"
emphasizes the in-memory format, and the indirection provided by the
bufpage.c slotted page format (i.e. line pointer array indirection).

This line pointer indirection is really central to lots of important
things, including (just for example) our "physiological" approach to
WAL logging -- WAL records describe changes in a way that is physical
to a block, logical within a page. Most users don't need to care about
these distinctions, but hackers might find the nuance of it quite
useful. It bleeds into a lot of things, and is quite easy to take for
granted -- which might actually cost you.

--
Peter Geoghegan



В списке pgsql-docs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: relpages in pg_class
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: relpages in pg_class