Printing page request trace from buffer manager

From: Irodotos Terpizis <irodotosterpizis(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Printing page request trace from buffer manager
Date: 2020-12-08 07:43:42
Message-ID: CAEfwbXMQnPzy=Od+Kr+nUT_YWcxr_u0acOVXb7eZFqbBtcSF_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

A description of what you are trying to achieve and what results you expect.:
I am a student and I am new in PSQL. I am working on a research
project and an initial step is

to trace the page request of the buffer manager. I need to know which
page was evicted from the buffer and
which page replaced it. For each request, I want to know the relation
oid and the blocknumber. In the end, I want to feed this

information to a Machine learning model, that is why I it is essential
for me to create an easy-to-process trace.

Initially, I modified the code within the BufferAlloc method in the
bufmgr.c file,

to log the pages that were requested and were already in the cache,
the pages that were evicted and the pages that

replaced them. However, I feel that this might not be the most optimal
way, as the log file is a mess and

it is hard to analyze. I was wondering if there is a more optimal way
to achieve this.

PostgreSQL version number you are running:
PostgreSQL 12.4, compiled by Visual C++ build 1927, 64-bit

How you installed PostgreSQL:
Downloaded the Source code from the github repository, build using
Visual Studio 2019.

Changes made to the settings in the postgresql.conf file*: see Server
Configuration <https://wiki.postgresql.org/wiki/Server_Configuration>
for a quick way to list them all.*
logging_collector = on
log_rotation_age = 0
log_min_error_statement = panic
log_error_verbosity = terse
log_statement = 'all'

Operating system and version:
Windows 10 Version 1909

I apologise if this is the wrong list to post. Please direct me to an
appropriate one if you feel this question is irrelevant.

Thank you for your time and help.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Li Japin 2020-12-08 07:45:52 Re: About to add WAL write/fsync statistics to pg_stat_wal view
Previous Message David Rowley 2020-12-08 07:15:52 Re: Hybrid Hash/Nested Loop joins and caching results from subplans