All Products
Search
Document Center

PolarDB:Global AWR user guide

Last Updated:Mar 28, 2026

Diagnosing performance issues across a PolarDB for PostgreSQL cluster is difficult when you have to check each node separately. Global Automatic Workload Repository (AWR) collects second-level performance metrics from every primary and read-only node simultaneously and surfaces them in a single Grafana dashboard—so you can correlate database load with resource consumption, trace performance jitter to the exact second, and identify top SQL statements, top tables, and top indexes without switching between nodes.

How it works

Global AWR uses a three-layer pipeline to move data from nodes to your dashboard:

LayerComponentRole
CollectionUE (proxy process on physical machines)Collects performance data and event information from all PolarDB for PostgreSQL cluster nodes
StorageLocal database (polar_gawr_collection schema in postgres)Optionally stores collected data in the cluster for continuous fine-grained reporting
PresentationGrafana dashboardsVisualizes performance trends and events; requires the cluster as a PostgreSQL data source
Global AWR architecture

What you can analyze

The Grafana dashboard provides four diagnostic views:

ViewWhen to use it
Average Active Sessions trendCorrelate database load with resource consumption to find performance bottlenecks. The chart shows event-level detail—for example, the following chart identifies a disconnection at 20:09:22.
Memory usage and memory contextInspect per-statement memory allocation to diagnose memory pressure on specific SQL statements.
Top SQL statements and top tablesIdentify the heaviest resource consumers across the cluster.
Top indexesIdentify the most-accessed indexes to diagnose index-level performance issues.
image.pngimage.pngimage.png

Before you begin

Confirm the following before you enable global AWR:

RequirementDetails
Kernel versionPolarDB for PostgreSQL kernel version 20211231 or later
PermissionsControl and data permissions for global AWR are PUBLIC
Time zoneThe cluster default time zone is UTC. Account for the time difference when you interpret performance data.

To check your kernel version, run:

show polar_release_date;

Expected output:

 polar_release_date
--------------------
 20211231
(1 row)

Enable local storage for global AWR data

Local storage lets global AWR generate fine-grained performance reports continuously, without requiring periodic snapshot triggers.

Important

Enabling local storage adds overhead to your cluster. Evaluate the following before proceeding:

  • Performance overhead: Overall performance loss is within 10%.

  • Storage overhead: Data is retained for 3 days by default. The most fine-grained data for 3 days must be less than 10 GB.

Run all statements in the postgres database.

Enable local storage:

SELECT polar_gawr_collection.enable_store_in_localdb();

Expected output:

 enable_store_in_localdb
-------------------------

(1 row)

Disable local storage:

SELECT polar_gawr_collection.disable_store_in_localdb();

Expected output:

 disable_store_in_localdb
--------------------------

(1 row)

Check whether local storage is enabled:

SELECT polar_gawr_collection.show_store_in_localdb();

Expected output (t = enabled):

 show_store_in_localdb
-----------------------
 t
(1 row)

Set up Grafana

Install Grafana

Download and install Grafana 8.1.2 or later from the Grafana download page.

Add a data source

  1. Start Grafana. In the left-side navigation pane, choose Configuration > Data sources.

  2. On the Data sources tab, click Add data source in the upper-right corner.

    导入数据库实例

  3. Enter the connection information for the cluster.

    In the Database field, enter postgres.

    image.png

Import the dashboard configuration file

  1. In the left-side navigation pane, choose + > Import.

  2. On the Import page, click Upload JSON file and select the dashboard configuration file.

    Download the dashboard configuration file from PolarDB Global AWR-1712645731515.json. Decompress the file before importing.

    导入JSON文件