pg_relusage
pg_relusage : Log all the queries that reference a particular column
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 6850 | pg_relusage | pg_relusage | 1.0.2 |
STAT | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --sL--r | No | Yes | Yes | No | yes | no |
| Relationships | |
|---|---|
| See Also | pg_qualstats online_advisor hypopg pg_stat_statements index_advisor pg_stat_plans pg_upless pg_hint_plan pg_track_optimizer plan_filter |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0.2 |
18 17 16 15 14 | pg_relusage |
- |
| RPM | PIGSTY | 1.0.2 |
18 17 16 15 14 | pg_relusage_$v |
- |
| DEB | PIGSTY | 1.0.2 |
18 17 16 15 14 | postgresql-$v-pg-relusage |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| el8.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| el9.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| el9.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| el10.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| el10.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| d12.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| d12.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| d13.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| d13.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| u22.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| u22.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| u24.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| u24.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| u26.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| u26.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
Source
github.com/adept/pg_relusage
pg_relusage-1.0.2.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Config this extension to shared_preload_libraries:
This extension does not need CREATE EXTENSION DDL command
Usage
Sources:
pg_relusage 1.0.2 logs relations used by statements after plan simplification. It supports PostgreSQL 10–18 and defines no SQL objects. Loading the library enables it; optional CREATE EXTENSION only records installation.
Core Workflow
Operational Boundaries
All settings require superuser: pg_relusage.enabled defaults on, pg_relusage.log_level defaults log and pg_relusage.rel_kinds defaults riSvmfp. pg_relusage.nested_statements accepts all (default: each statement), top (ignore nested statements) or fold (merge nested relations into the outer log). Version 1.0.1 fixes fold handling after a failed subtransaction.
Use session_preload_libraries for new sessions without a restart, or shared_preload_libraries for all sessions with a restart; preserve existing preload entries. LOAD normally requires superuser. Log messages omit SQL text, so configure log_line_prefix to identify the client.
System catalogs are excluded. Relations eliminated by planning or startup pruning are excluded, but partitions skipped later during execution can still appear. INSERT into a partitioned table reports only its parent. Deferred triggers at COMMIT, COPY FROM triggers and planner-invoked functions are treated as top-level statements. DDL and maintenance commands are excluded. A quiet log alone does not prove an object can be dropped.
1.0.2 and Partitioned Tables
Version 1.0.2 reduces relation-membership and partition-matching overhead for statements involving many partitions. Log format and settings are unchanged. Replace the library and restart if using shared preload, or reconnect when using session preload or LOAD. If installation was recorded with CREATE EXTENSION, also run ALTER EXTENSION pg_relusage UPDATE.