How to find the number of cached pages for a relation?

From: Amin <amin(dot)fallahi(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: How to find the number of cached pages for a relation?
Date: 2023-01-14 01:28:31
Message-ID: CAF-KA8_axSMpQW1scOTnAQx8NFHgmJc6L87QzAo3JezLiBU1HQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Before scanning a relation, in the planner stage, I want to make a call to
retrieve information about how many pages will be a hit for a specific
relation. The module pg_buffercache seems to be doing a similar thing.
Also, pg_statio_all_tables seems to be having that information, but it is
updated after execution. However, I want the information before execution.
Also not sure how pg_statio_all_tables is created and how I can access it
in the code.

Thank you!

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2023-01-14 01:29:00 Re: pgsql: Add new GUC createrole_self_grant.
Previous Message Andrew Dunstan 2023-01-14 01:12:39 Announcing Release 16 of the PostgreSQL Buildfarm client