# waitforgraph **Repository Path**: hidva/waitforgraph ## Basic Information - **Project Name**: waitforgraph - **Description**: Generate the locks wait-for graph for Greenplum 4.x, 5.x, 6.x, 7.x~ - **Primary Language**: Rust - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-04-24 - **Last Updated**: 2022-04-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: greenplum, Lock ## README A utility used for generating locks wait-for graph for Greenplum Database ```bash # Use PG* environment variables (PGDATABASE, PGUSER, ...) as connection information by default waitforgraph > wfg.dot dot -T svg < wfg.dot > wfg.svg # also support Connection String described in https://www.postgresql.org/docs/current/libpq-connect.html waitforgraph dbname=DATABASENAME | dot -T svg > wfg.svg open wfg.svg ``` ```bash waitforgraph > wfg.dot # Sometimes we are only interested in one subgraph of the graph. # And 2018128 is the start point of subgraph. grep -F -- '->' wft.dot | subgraph 20181218 > wfg.subgraph.dot dot -T svg < wfg.subgraph.dot > wfg.subgraph.svg open wfg.subgraph.svg ``` The locks wait-for graph looks as follow: ![gdd.dot](https://raw.githubusercontent.com/hidva/waitforgraph/master/assets/wfg.svg) There is more detailed information in the dot file: ```dot strict digraph G { label="WaitForGraph - Generated By hidva/waitforgraph"; 29968; 29970; 29970 -> 29968 } /*大吉大利~ session 29970 waits for AccessShareLock on locktype=relation,gp_segment_id=-1,database=10902,relation=16395; blocked by session 29968(granted AccessExclusiveLock); */ ```