pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_class.relpages documentation does not mention relpages corner case
2+ messages / 2 participants
[nested] [flat]

* pg_class.relpages documentation does not mention relpages corner case
@ 2023-06-05 23:03 PG Doc comments form <noreply@postgresql.org>
  2023-09-07 18:21 ` Re: pg_class.relpages documentation does not mention relpages corner case Bruce Momjian <bruce@momjian.us>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Doc comments form @ 2023-06-05 23:03 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org; +Cc: m.sakrejda@gmail.com

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/14/catalog-pg-class.html
Description:

In the pg_class documentation [1], the relpages column is described as

>Size of the on-disk representation of this table in pages (of size BLCKSZ).
This is only an estimate used by the planner. It is updated by VACUUM,
ANALYZE, and a few DDL commands such as CREATE INDEX.

However, it looks like this is -1 for partitioned tables. At least for ones
that have children and have been analyze since adding a child partition, it
seems. I'm not sure how to word that concisely, but should the documentation
note this case? Or can this just be zero for partitioned tales? I'm not sure
if it's too late for that, but they don't actually have any relpages, so it
seems odd that they need a sentinel value.

Thanks,
Maciek

[1]: https://www.postgresql.org/docs/current/catalog-pg-class.html


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: pg_class.relpages documentation does not mention relpages corner case
  2023-06-05 23:03 pg_class.relpages documentation does not mention relpages corner case PG Doc comments form <noreply@postgresql.org>
@ 2023-09-07 18:21 ` Bruce Momjian <bruce@momjian.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Bruce Momjian @ 2023-09-07 18:21 UTC (permalink / raw)
  To: m.sakrejda@gmail.com; pgsql-docs@lists.postgresql.org

On Mon, Jun  5, 2023 at 11:03:49PM +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:
> 
> In the pg_class documentation [1], the relpages column is described as
> 
> >Size of the on-disk representation of this table in pages (of size BLCKSZ).
> This is only an estimate used by the planner. It is updated by VACUUM,
> ANALYZE, and a few DDL commands such as CREATE INDEX.
> 
> However, it looks like this is -1 for partitioned tables. At least for ones
> that have children and have been analyze since adding a child partition, it
> seems. I'm not sure how to word that concisely, but should the documentation
> note this case? Or can this just be zero for partitioned tales? I'm not sure
> if it's too late for that, but they don't actually have any relpages, so it
> seems odd that they need a sentinel value.

Uh, there are discussions about needing to run ANALYZE on partitioned
tables, so in those cases the statistics would be cumulative of all
partitions:

	https://www.postgresql.org/message-id/20230112232747.GA2111950@nathanxps13

If we set the relpages to zero, that would not be reflecting the
partitions.  I feel -1 is probably the best unless we want to put the
total of all partitions in there, but that would be confusing too.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2023-09-07 18:21 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-06-05 23:03 pg_class.relpages documentation does not mention relpages corner case PG Doc comments form <noreply@postgresql.org>
2023-09-07 18:21 ` Bruce Momjian <bruce@momjian.us>

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