pg_track_optimizer
Track planning decisions in comparison with execution reality
pg_track_optimizer : Track planning decisions in comparison with execution reality
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 6270 | pg_track_optimizer | pg_track_optimizer | 0.9.2 |
STAT | MIT | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --sLd-r | No | Yes | Yes | Yes | yes | no |
| Relationships | |
|---|---|
| See Also | online_advisor pg_qualstats hypopg index_advisor pg_hint_plan pg_stat_plans plan_filter pg_relusage pg_strom pg_orca |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.9.2 |
18 17 16 15 14 | pg_track_optimizer |
- |
| RPM | PIGSTY | 0.9.2 |
18 17 16 15 14 | pg_track_optimizer_$v |
- |
| DEB | PIGSTY | 0.9.2 |
18 17 16 15 14 | postgresql-$v-pg-track-optimizer |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.9.2 | PIGSTY 0.9.2 | N/A | N/A | N/A |
| el8.aarch64 | PIGSTY 0.9.2 | PIGSTY 0.9.2 | N/A | N/A | N/A |
| el9.x86_64 | PIGSTY 0.9.2 | PIGSTY 0.9.2 | N/A | N/A | N/A |
| el9.aarch64 | PIGSTY 0.9.2 | PIGSTY 0.9.2 | N/A | N/A | N/A |
| el10.x86_64 | PIGSTY 0.9.2 | PIGSTY 0.9.2 | N/A | N/A | N/A |
| el10.aarch64 | PIGSTY 0.9.2 | PIGSTY 0.9.2 | N/A | N/A | N/A |
| d12.x86_64 | PIGSTY 0.9.2 | PIGSTY 0.9.2 | N/A | N/A | N/A |
| d12.aarch64 | PIGSTY 0.9.2 | PIGSTY 0.9.2 | N/A | N/A | N/A |
| d13.x86_64 | PIGSTY 0.9.2 | PIGSTY 0.9.2 | N/A | N/A | N/A |
| d13.aarch64 | PIGSTY 0.9.2 | PIGSTY 0.9.2 | N/A | N/A | N/A |
| u22.x86_64 | PIGSTY 0.9.2 | PIGSTY 0.9.2 | N/A | N/A | N/A |
| u22.aarch64 | PIGSTY 0.9.2 | PIGSTY 0.9.2 | N/A | N/A | N/A |
| u24.x86_64 | PIGSTY 0.9.2 | PIGSTY 0.9.2 | N/A | N/A | N/A |
| u24.aarch64 | PIGSTY 0.9.2 | PIGSTY 0.9.2 | N/A | N/A | N/A |
| u26.x86_64 | PIGSTY 0.9.2 | PIGSTY 0.9.2 | N/A | N/A | N/A |
| u26.aarch64 | PIGSTY 0.9.2 | PIGSTY 0.9.2 | N/A | N/A | N/A |
Source
github.com/danolivo/pg_track_optimizer
pg_track_optimizer-0.9.2.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_track_optimizer: detect suboptimal query plans via cardinality estimation errors
pg_track_optimizer automatically detects queries with poor cardinality estimates by comparing planner predictions to actual execution results. It calculates multiple error metrics using logarithmic scale.
Enable Tracking
Viewing Tracked Queries
Error Metrics
| Metric | Description |
|---|---|
avg_error |
Simple average of log-scale errors across plan nodes |
rms_error |
Root Mean Square, emphasizes large errors |
twa_error |
Time-Weighted Average, highlights slow nodes |
wca_error |
Cost-Weighted Average, highlights high-cost nodes |
f_join_filter |
JOIN filtering overhead factor |
f_scan_filter |
Scan filtering overhead factor |
Managing Statistics
Configuration
| Parameter | Default | Description |
|---|---|---|
pg_track_optimizer.mode |
disabled |
disabled, normal, forced |
pg_track_optimizer.log_min_error |
(none) | Error threshold for logging EXPLAIN |
pg_track_optimizer.hash_mem |
(default) | Shared memory limit in KB |
pg_track_optimizer.auto_flush |
on |
Auto-save stats on backend shutdown |