pg_stat_kcache
Kernel statistics gathering
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_stat_kcache | 2.3.2 | STAT | BSD-3-Clause | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 6220 | pg_stat_kcache | No | Yes | Yes | Yes | No | Yes | - |
| Related | pg_stat_statements pgnodemx system_stats pgmeminfo pgmonitor pg_stat_ch pg_datasentinel pgsentinel |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PGDG | 2.3.2 | 1817161514 | pg_stat_kcache | pg_stat_statements |
| RPM | PGDG | 2.3.1 | 1817161514 | pg_stat_kcache_$v | - |
| DEB | PGDG | 2.3.2 | 1817161514 | postgresql-$v-pg-stat-kcache | - |
Install
You can install pg_stat_kcache directly. First, make sure the PGDG repository is added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Preload:
Create Extension:
Usage
pg_stat_kcache gathers statistics about real reads and writes done by the filesystem layer, as well as CPU usage per query. It requires pg_stat_statements.
Views
pg_stat_kcache – aggregated per-database statistics:
| Column | Type | Description |
|---|---|---|
datname | name | Database name |
exec_user_time | double precision | User CPU time executing statements (seconds) |
exec_system_time | double precision | System CPU time executing statements (seconds) |
exec_reads | bigint | Bytes read by filesystem layer |
exec_reads_blks | bigint | 8K blocks read by filesystem layer |
exec_writes | bigint | Bytes written by filesystem layer |
exec_writes_blks | bigint | 8K blocks written by filesystem layer |
plan_user_time | double precision | User CPU time planning (if tracking enabled) |
plan_system_time | double precision | System CPU time planning (if tracking enabled) |
pg_stat_kcache_detail – per-query statistics including query text, role, and database.
Functions
Configuration
| Parameter | Default | Description |
|---|---|---|
pg_stat_kcache.linux_hz | -1 | Linux CONFIG_HZ (auto-detected) |
pg_stat_kcache.track | top | Track: top, all, or none |
pg_stat_kcache.track_planning | off | Track planning statistics (PG 13+) |
Example
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)