pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedrelpages in pg_class
7+ messages / 6 participants
[nested] [flat]
* relpages in pg_class
@ 2022-08-19 04:10 PG Doc comments form <noreply@postgresql.org>
2022-08-19 15:46 ` Re: relpages in pg_class Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 7+ messages in thread
From: PG Doc comments form @ 2022-08-19 04:10 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: shangzi.x@columbia.edu
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/14/catalog-pg-class.html
Description:
From source code, the relpage is the number of blocks. But, at the document,
it is written as Size of the on-disk representation of this table in pages
(of size BLCKSZ).
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: relpages in pg_class
2022-08-19 04:10 relpages in pg_class PG Doc comments form <noreply@postgresql.org>
@ 2022-08-19 15:46 ` Bruce Momjian <bruce@momjian.us>
2022-08-19 16:01 ` Re: relpages in pg_class Alvaro Herrera <alvherre@alvh.no-ip.org>
0 siblings, 1 reply; 7+ messages in thread
From: Bruce Momjian @ 2022-08-19 15:46 UTC (permalink / raw)
To: shangzi.x@columbia.edu; pgsql-docs@lists.postgresql.org
On Fri, Aug 19, 2022 at 04:10:30AM +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/14/catalog-pg-class.html
> Description:
>
> From source code, the relpage is the number of blocks. But, at the document,
> it is written as Size of the on-disk representation of this table in pages
> (of size BLCKSZ).
Well, blocks and pages are the same size, so I don't see the problem.
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
Indecision is a decision. Inaction is an action. Mark Batterson
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: relpages in pg_class
2022-08-19 04:10 relpages in pg_class PG Doc comments form <noreply@postgresql.org>
2022-08-19 15:46 ` Re: relpages in pg_class Bruce Momjian <bruce@momjian.us>
@ 2022-08-19 16:01 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
2022-08-19 16:39 ` Re: relpages in pg_class Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 7+ messages in thread
From: Alvaro Herrera @ 2022-08-19 16:01 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: shangzi.x@columbia.edu; pgsql-docs@lists.postgresql.org
On 2022-Aug-19, Bruce Momjian wrote:
> On Fri, Aug 19, 2022 at 04:10:30AM +0000, PG Doc comments form wrote:
> > The following documentation comment has been logged on the website:
> >
> > Page: https://www.postgresql.org/docs/14/catalog-pg-class.html
> > Description:
> >
> > From source code, the relpage is the number of blocks. But, at the document,
> > it is written as Size of the on-disk representation of this table in pages
> > (of size BLCKSZ).
>
> Well, blocks and pages are the same size, so I don't see the problem.
If you think about operating system "blocks" rather than Postgres
"blocks", I can see how this can be interpreted differently. I'm not
sure if this is a good place to make that distinction, though; I mean,
if we do, how many other places should we patch similarly?
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Small aircraft do not crash frequently ... usually only once!"
(ponder, http://thedailywtf.com/)
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: relpages in pg_class
2022-08-19 04:10 relpages in pg_class PG Doc comments form <noreply@postgresql.org>
2022-08-19 15:46 ` Re: relpages in pg_class Bruce Momjian <bruce@momjian.us>
2022-08-19 16:01 ` Re: relpages in pg_class Alvaro Herrera <alvherre@alvh.no-ip.org>
@ 2022-08-19 16:39 ` Tom Lane <tgl@sss.pgh.pa.us>
2022-08-19 18:25 ` Re: relpages in pg_class Peter Geoghegan <pg@bowt.ie>
0 siblings, 1 reply; 7+ messages in thread
From: Tom Lane @ 2022-08-19 16:39 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: Bruce Momjian <bruce@momjian.us>; shangzi.x@columbia.edu; pgsql-docs@lists.postgresql.org
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> On 2022-Aug-19, Bruce Momjian wrote:
>> Well, blocks and pages are the same size, so I don't see the problem.
> If you think about operating system "blocks" rather than Postgres
> "blocks", I can see how this can be interpreted differently. I'm not
> sure if this is a good place to make that distinction, though; I mean,
> if we do, how many other places should we patch similarly?
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?
regards, tom lane
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: relpages in pg_class
2022-08-19 04:10 relpages in pg_class PG Doc comments form <noreply@postgresql.org>
2022-08-19 15:46 ` Re: relpages in pg_class Bruce Momjian <bruce@momjian.us>
2022-08-19 16:01 ` Re: relpages in pg_class Alvaro Herrera <alvherre@alvh.no-ip.org>
2022-08-19 16:39 ` Re: relpages in pg_class Tom Lane <tgl@sss.pgh.pa.us>
@ 2022-08-19 18:25 ` Peter Geoghegan <pg@bowt.ie>
2022-08-19 19:16 ` Re: relpages in pg_class Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 7+ messages in thread
From: Peter Geoghegan @ 2022-08-19 18:25 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>; Bruce Momjian <bruce@momjian.us>; shangzi.x@columbia.edu, Pg Docs <pgsql-docs@lists.postgresql.org>
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
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: relpages in pg_class
2022-08-19 04:10 relpages in pg_class PG Doc comments form <noreply@postgresql.org>
2022-08-19 15:46 ` Re: relpages in pg_class Bruce Momjian <bruce@momjian.us>
2022-08-19 16:01 ` Re: relpages in pg_class Alvaro Herrera <alvherre@alvh.no-ip.org>
2022-08-19 16:39 ` Re: relpages in pg_class Tom Lane <tgl@sss.pgh.pa.us>
2022-08-19 18:25 ` Re: relpages in pg_class Peter Geoghegan <pg@bowt.ie>
@ 2022-08-19 19:16 ` Bruce Momjian <bruce@momjian.us>
2022-08-21 14:30 ` Re: relpages in pg_class Shangzi Xie <shangzi.x@columbia.edu>
0 siblings, 1 reply; 7+ messages in thread
From: Bruce Momjian @ 2022-08-19 19:16 UTC (permalink / raw)
To: Peter Geoghegan <pg@bowt.ie>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Alvaro Herrera <alvherre@alvh.no-ip.org>; shangzi.x@columbia.edu, Pg Docs <pgsql-docs@lists.postgresql.org>
On Fri, Aug 19, 2022 at 11:25:52AM -0700, Peter Geoghegan wrote:
> 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).
Yes, I have heard the block-disk, page-memory explanation before.
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
Indecision is a decision. Inaction is an action. Mark Batterson
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: relpages in pg_class
2022-08-19 04:10 relpages in pg_class PG Doc comments form <noreply@postgresql.org>
2022-08-19 15:46 ` Re: relpages in pg_class Bruce Momjian <bruce@momjian.us>
2022-08-19 16:01 ` Re: relpages in pg_class Alvaro Herrera <alvherre@alvh.no-ip.org>
2022-08-19 16:39 ` Re: relpages in pg_class Tom Lane <tgl@sss.pgh.pa.us>
2022-08-19 18:25 ` Re: relpages in pg_class Peter Geoghegan <pg@bowt.ie>
2022-08-19 19:16 ` Re: relpages in pg_class Bruce Momjian <bruce@momjian.us>
@ 2022-08-21 14:30 ` Shangzi Xie <shangzi.x@columbia.edu>
0 siblings, 0 replies; 7+ messages in thread
From: Shangzi Xie @ 2022-08-21 14:30 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Peter Geoghegan <pg@bowt.ie>; Tom Lane <tgl@sss.pgh.pa.us>; Alvaro Herrera <alvherre@alvh.no-ip.org>; Pg Docs <pgsql-docs@lists.postgresql.org>
Page and block can be used interchangeably, but the description of relpages
in the documentation can be confusing to someone who doesn't care much
about the difference between page and block.
When I want to count pages from a table, maybe the keywords I should look
for should be "the number of", but the relpages is described by document
with "Size of".
-----------------------------------------------
Shangzi Xie
On Sat, Aug 20, 2022 at 3:16 AM Bruce Momjian <bruce@momjian.us> wrote:
> On Fri, Aug 19, 2022 at 11:25:52AM -0700, Peter Geoghegan wrote:
> > 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).
>
> Yes, I have heard the block-disk, page-memory explanation before.
>
> --
> Bruce Momjian <bruce@momjian.us>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__momjian.us&d=DwIBAg&c=009klHSCxuh5AI1vN...
>
> EDB
> https://urldefense.proofpoint.com/v2/url?u=https-3A__enterprisedb.com&d=DwIBAg&c=009klHSCxuh...
>
>
> Indecision is a decision. Inaction is an action. Mark Batterson
>
>
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2022-08-21 14:30 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-08-19 04:10 relpages in pg_class PG Doc comments form <noreply@postgresql.org>
2022-08-19 15:46 ` Bruce Momjian <bruce@momjian.us>
2022-08-19 16:01 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
2022-08-19 16:39 ` Tom Lane <tgl@sss.pgh.pa.us>
2022-08-19 18:25 ` Peter Geoghegan <pg@bowt.ie>
2022-08-19 19:16 ` Bruce Momjian <bruce@momjian.us>
2022-08-21 14:30 ` Shangzi Xie <shangzi.x@columbia.edu>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox