Re: Add SQL function to show total block numbers in the relation

From: btkimurayuzk <btkimurayuzk(at)oss(dot)nttdata(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Add SQL function to show total block numbers in the relation
Date: 2019-11-07 08:04:51
Message-ID: 7369fa1cc4d212cbcbd2cdbd6031f0c0@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> btkimurayuzk <btkimurayuzk(at)oss(dot)nttdata(dot)com> writes:
>> I propose new simple sql query, which shows total block numbers in the
>> relation.
>> ...
>> Of cource, we can know this value such as
>> select (pg_relation_size('t') /
>> current_setting('block_size')::bigint)::int;
>
> I don't really see why the existing solution isn't sufficient.

I think it's a little difficult to introduce the block size using two
values `current block size` and `reference size`
for beginners who are not familiar with the internal structure of
Postgres,

This is the reason why the existing solution was insufficient.

What do you think?

Regards,
Yu Kimura

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gilles Darold 2019-11-07 08:05:55 Re: [PATCH][DOC] Fix for PREPARE TRANSACTION doc and postgres_fdw message.
Previous Message btkimurayuzk 2019-11-07 08:03:28 Re: pgbench - extend initialization phase control