Stay organized with collections
Save and categorize content based on your preferences.
To generate a server activity report, you can use the PostgreSQL cumulative statistics system to collect and report information about server activity. The server activity information is exposed as system tables, which can be accessed using SQL queries.
For example, the query reports the number of disk blocks found in the buffer cache and number of disk blocks read from disk:
SELECTblks_hit,blks_readFROMpg_stat_database;
By observing the values of these counters over time, you can infer whether the database is making good use of the buffer cache.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-05 UTC."],[[["PostgreSQL's cumulative statistics system gathers and reports on server activity."],["Server activity data is stored in system tables accessible via SQL queries."],["You can monitor buffer cache usage by tracking `blks_hit` and `blks_read` values."],["Detailed information about the cumulative statistics system is in the PostgreSQL documentation."]]],[]]