Add SQL function to show total block numbers in the relation

From: btkimurayuzk <btkimurayuzk(at)oss(dot)nttdata(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Add SQL function to show total block numbers in the relation
Date: 2019-10-30 07:48:00
Message-ID: 00d0b21ebbd42f22e118fe9afa47713e@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

I propose new simple sql query, which shows total block numbers in the
relation.

I now reviewing this patch (https://commitfest.postgresql.org/25/2211/)
and I think,
it is usefull for knowing how many blocks there are in the relation to
determine whether we use VACUUM RESUME or not.

Of cource, we can know this value such as

select (pg_relation_size('t') /
current_setting('block_size')::bigint)::int;

but I think it is a litte bit complex.

Comment and feedback are very welcome.

Regards ,

Yu Kimura

Attachment Content-Type Size
show_total_block_numbers-20191030.patch text/x-diff 3.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2019-10-30 07:48:59 Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions
Previous Message Michael Paquier 2019-10-30 07:40:45 Re: RFC: split OBJS lines to one object per line