plprofiler
server-side support for profiling PL/pgSQL functions
plprofiler : server-side support for profiling PL/pgSQL functions
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 3070 | plprofiler | plprofiler | 4.2.5 |
LANG | Artistic-1.0 | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --sLd-r | No | Yes | Yes | Yes | yes | no |
| Relationships | |
|---|---|
| See Also | plpgsql_check pldbgapi pglinter pg_stat_plans pg_stat_statements auto_explain pg_store_plans pg_show_plans hypopg index_advisor |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PGDG | 4.2.5 |
18 17 16 15 14 | plprofiler |
- |
| RPM | PGDG | 4.2.5 |
18 17 16 15 14 | plprofiler_$v |
- |
| DEB | PGDG | 4.2.5 |
18 17 16 15 14 | postgresql-$v-plprofiler |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 |
| el8.aarch64 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 |
| el9.x86_64 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 |
| el9.aarch64 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 |
| el10.x86_64 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 |
| el10.aarch64 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 |
| d12.x86_64 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 |
| d12.aarch64 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 |
| d13.x86_64 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 |
| d13.aarch64 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 |
| u22.x86_64 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 |
| u22.aarch64 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 |
| u24.x86_64 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 |
| u24.aarch64 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 |
| u26.x86_64 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 |
| u26.aarch64 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 | PGDG 4.2.5 |
Source
github.com/bigsql/plprofiler
Install
Make sure PGDG repo available:
Install this extension with pig:
Config this extension to shared_preload_libraries:
Create this extension with:
Usage
plprofiler: server-side support for profiling PL/pgSQL functions
plprofiler is a profiling tool for PL/pgSQL functions that identifies performance bottlenecks and generates interactive flame graph reports.
Configuration
Add to postgresql.conf:
Command-Line Tool
The plprofiler command-line utility controls profiling and generates reports:
SQL Interface
Report Output
Generated HTML reports include:
- Interactive flame graphs showing wall-clock time spent in PL/pgSQL code
- Per-function statistics with self-time (total minus children)
- Top functions ranked by time consumption (default: top 10)
- Self-contained HTML requiring no external dependencies
Profiling Methods
- Direct profiling: Run specific SQL while collecting data
- Timed collection: Interval-based statistics gathering
- Per-user profiling: Enable profiling for specific database users via
ALTER USER - Production monitoring: Low-overhead profiling on live systems