How avamingli/whpg_plan_tree works
whpg_plan_tree is a WarehousePG/GPDB extension for capturing the executing query’s actual plan tree and exposing it through SQL. At query start, the metrics hook triggers capture into a shared-memory pool; SQL consumers can read that plan and, where the kernel library is available, join it with live per-node counters. pg_dash’s Watch feature is a documented consumer. The C excerpt confirms capture and shared-memory responsibilities; SQL and integration links are based on README statements, not inspected SQL definitions.
Main entry points: whpg_plan_tree--1.0.0.sql Plan Detail · whpg_plan_tree.c Metrics Hook
Components 9
Plan Capture
- Metrics Hook
whpg_plan_tree.c - Plan Capture
whpg_plan_tree.c - Plan Pool
whpg_plan_tree.c
SQL Interface
- Plan Detail
whpg_plan_tree--1.0.0.sql - Instrument Detail
whpg_plan_tree--1.0.0.sql
Monitoring Integrations
- Metrics Ring
- pg_dash Watch
Other components
- Running Query
- SQL Consumer
Connections 9
- Running Query → Metrics Hook: starts query
README.md - Metrics Hook → Plan Capture: triggers capture
README.md - Plan Capture → Plan Pool: writes plan
README.md - Plan Pool → Plan Detail: supplies rows
README.md - Metrics Ring → Instrument Detail: supplies counters
README.md - SQL Consumer → Plan Detail: queries
README.md - SQL Consumer → Instrument Detail: queries
README.md - pg_dash Watch → Plan Detail: reads plan
README.md - pg_dash Watch → Instrument Detail: joins counters
README.md