pg_wait_sampling
sampling based statistics of wait events
pg_wait_sampling : sampling based statistics of wait events
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 6280 | pg_wait_sampling | pg_wait_sampling | 1.1.11 |
STAT | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --sLd-r | No | Yes | Yes | Yes | yes | no |
| Relationships | |
|---|---|
| See Also | pg_profile pgsentinel pg_stat_monitor pg_datasentinel powa pgrowlocks pg_visibility pg_show_plans pg_stat_statements pg_stat_plans |
PIGSTY RPM and PGDG DEB package version 1.1.11 cover PostgreSQL 14-18; SQL/control version is 1.1 and shared_preload_libraries=pg_wait_sampling is required.
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | MIXED | 1.1.11 |
18 17 16 15 14 | pg_wait_sampling |
- |
| RPM | PIGSTY | 1.1.11 |
18 17 16 15 14 | pg_wait_sampling_$v |
- |
| DEB | PGDG | 1.1.11 |
18 17 16 15 14 | postgresql-$v-pg-wait-sampling |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.1.11 | PIGSTY 1.1.11 | PIGSTY 1.1.11 | PIGSTY 1.1.11 | PIGSTY 1.1.11 |
| el8.aarch64 | PIGSTY 1.1.11 | PIGSTY 1.1.11 | PIGSTY 1.1.11 | PIGSTY 1.1.11 | PIGSTY 1.1.11 |
| el9.x86_64 | PIGSTY 1.1.11 | PIGSTY 1.1.11 | PIGSTY 1.1.11 | PIGSTY 1.1.11 | PIGSTY 1.1.11 |
| el9.aarch64 | PIGSTY 1.1.11 | PIGSTY 1.1.11 | PIGSTY 1.1.11 | PIGSTY 1.1.11 | PIGSTY 1.1.11 |
| el10.x86_64 | PIGSTY 1.1.11 | PIGSTY 1.1.11 | PIGSTY 1.1.11 | PIGSTY 1.1.11 | PIGSTY 1.1.11 |
| el10.aarch64 | PIGSTY 1.1.11 | PIGSTY 1.1.11 | PIGSTY 1.1.11 | PIGSTY 1.1.11 | PIGSTY 1.1.11 |
| d12.x86_64 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 |
| d12.aarch64 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 |
| d13.x86_64 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 |
| d13.aarch64 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 |
| u22.x86_64 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 |
| u22.aarch64 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 |
| u24.x86_64 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 |
| u24.aarch64 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 |
| u26.x86_64 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 |
| u26.aarch64 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 | PGDG 1.1.11 |
Source
github.com/postgrespro/pg_wait_sampling
pg_wait_sampling-1.1.11.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Config this extension to shared_preload_libraries:
Create this extension with:
Usage
pg_wait_sampling collects wait event statistics by periodically sampling what each backend is waiting on. It provides both a recent history ring buffer and a cumulative profile.
Views
Current wait events:
| Column | Type | Description |
|---|---|---|
pid |
int4 | Process ID |
event_type |
text | Wait event type |
event |
text | Wait event name |
queryid |
int8 | Query ID |
Wait event history (ring buffer of recent samples):
| Column | Type | Description |
|---|---|---|
pid |
int4 | Process ID |
ts |
timestamptz | Sample timestamp |
event_type |
text | Wait event type |
event |
text | Wait event name |
queryid |
int8 | Query ID |
Wait event profile (cumulative counts):
| Column | Type | Description |
|---|---|---|
pid |
int4 | Process ID |
event_type |
text | Wait event type |
event |
text | Wait event name |
queryid |
int8 | Query ID |
count |
text | Count of samples |
Get current wait event for a specific process:
Reset Profile
Configuration
| Parameter | Default | Description |
|---|---|---|
pg_wait_sampling.history_size |
5000 | Ring buffer size |
pg_wait_sampling.history_period |
10 | History sampling period (ms) |
pg_wait_sampling.profile_period |
10 | Profile sampling period (ms) |
pg_wait_sampling.profile_pid |
true |
Collect profile per-process |
pg_wait_sampling.profile_queries |
top |
Per-query profile: none, top, all |
pg_wait_sampling.sample_cpu |
true |
Sample on-CPU backends (event columns NULL) |