Install the whpg_live_query_plan extension on your WarehousePG (WHPG) cluster to use the live query plan in WEM. The extension is optional.
Run these steps as gpadmin on the coordinator:
Download the package from the EDB repository:
export EDB_SUBSCRIPTION_TOKEN=<your-token> export EDB_REPO=gpsupp curl -1sSLf "https://downloads.enterprisedb.com/$EDB_SUBSCRIPTION_TOKEN/$EDB_REPO/setup.rpm.sh" | sudo -E bash sudo dnf download edb-whpg<major_version>-live-query-plan
export EDB_SUBSCRIPTION_TOKEN=<your-token> export EDB_REPO=gpsupp curl -1sSLf "https://downloads.enterprisedb.com/$EDB_SUBSCRIPTION_TOKEN/$EDB_REPO/setup.rpm.sh" | sudo -E bash sudo yumdownloader edb-whpg<major_version>-live-query-plan
<your-token>is the token you received when you registered for the EDB subscription, and<major_version>is your WHPG version, 6 or 7.Create a file
all_hostson the coordinator, listing all hosts in the cluster. For example:cdw scdw sdw1 sdw2 sdw3
Use the
gpsyncutility to transfer the package to all hosts in the cluster, then use thegpsshutility to install it:gpsync -f all_hosts edb-whpg<major_version>-live-query-plan-*.rpm =:/tmp gpssh -f all_hosts -u gpadmin -e "sudo dnf install -y /tmp/edb-whpg<major_version>-live-query-plan-*.rpm"
gpsync -f all_hosts edb-whpg<major_version>-live-query-plan-*.rpm =:/tmp gpssh -f all_hosts -u gpadmin -e "sudo yum install -y /tmp/edb-whpg<major_version>-live-query-plan-*.rpm"
Load the extension as a shared library. Check for existing shared libraries. The coordinator and the segments can have different values, so read both:
gpconfig -s shared_preload_librariesEnable
whpg_live_query_planand turn on query metrics.gpconfig -csets one value on every host, so keep the libraries that are already listed on any host.If other libraries are listed, for example
pg_cron, add the extension after them:gpconfig -c shared_preload_libraries -v 'pg_cron,whpg_live_query_plan' gpconfig -c gp_enable_query_metrics -v on
If no libraries are listed, set the extension alone:
gpconfig -c shared_preload_libraries -v whpg_live_query_plan gpconfig -c gp_enable_query_metrics -v on
Restart WHPG:
gpstop -rafCreate the extension in the database that
WHPG_DATABASEin/etc/edb/wem/wem.confnames. This is the database WEM connects to. Management > Settings also shows it in WHPG Connection.CREATE EXTENSION whpg_live_query_plan;
To watch a running query, see Viewing query plans.