9.3.2

Table Of Contents
Prerequisites
n
Connect to the vFabric Postgres GUI. See “Access the Graphical User Interface,” on page 39.
n
To create a snapshot using Pgstatpack, you must first enable the Pgstatpack extension. See “Enable
Pgstatpack,” on page 36.
Procedure
1 Connect to the vFabric Postgres GUI, and click Enter SQL.
2 Create a snapshot using the SQL statement SELECT pgstatspack_create_snap('$DESCRIPTION'); in the
Entry pane.
If you do not specify a description, the name of the user role creating the snapshot and an automatically
generated timestamp is used to identify the snapshot.
This example creates a snapshot using the label vpg_snapshot to identify it.
SELECT pgstatspack_create_snap ('$vpg_snapshot');
What to do next
You can generate reports from the snapshots you create.
Generating vFabric Postgres Performance Reports
You generate Pgsnapstat performance reports from the snapshots you create.
Performance reports are generated by comparing the differences between two snapshots using the
Pgstatcheck function pgstatspack_generate_report. You can view the list of available snapshots in the
pgstatspack_snap table.
Prerequisites
n
To generate a performance report using Pgstatpack, you must first enable the Pgstatpack extension. See
“Enable Pgstatpack,” on page 36.
n
You must create two or more snapshots of performance data from which to generate performance
reports. See “Generating vFabric Postgres Performance Reports,” on page 37.
Procedure
1 Specify two snapshot IDs as arguments to the pgstatspack_generate_report function.
If the IDs you specify do not exist, or the start ID is newer that the stop ID, Pgstatpack returns an error.
SELECT pgstatspack_generate_report(1, 100);
The output generated by this function is a text tuple (an ordered list of elements) that you can save into
another format.
2 You can copy the output to a directory and file that you specify in a CSV file format.
COPY (select pgstatspack_generate_report(1,2)) TO '/directory/filename.csv' with csv;
Chapter 4 Managing vFabric Postgres
VMware, Inc. 37