Updated on 2023-10-09 GMT+08:00

Other Extension Plug-Ins

In addition to mandatory plug-ins pg_stat_statements, btree_gist, and PoWA, the following plug-ins are used for collecting new performance indicators:

  • pg_qualstats
  • pg_stat_kcache
  • pg_wait_sampling
  • pg_track_settings
  • hypopg

Each of the plug-ins can extend different performance metrics.

Currently, only pg_track_settings is supported on Huawei Cloud.

pg_track_settings Plug-In Extension

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Relational Database Service.
  4. On the Instances page, locate the target DB instance and click Log In in the Operation column.

    Alternatively, click the instance name on the Instances page. On the displayed Basic Information page, click Log In in the upper right corner of the page.

  5. On the displayed login page, enter the correct username and password and click Log In.
  6. Select the powa database and run the SQL command to create pg_track_settings.

    select control_extension('create', 'pg_track_settings');

  7. Create a PostgreSQL database (powa-repository) on the ECS, and install and activate pg_track_settings to collect performance metrics.

    # pg_track_settings
    cd /home/postgres/env
    wget https://github.com/rjuju/pg_track_settings/archive/refs/tags/2.0.1.tar.gz
    mv 2.0.1.tar.gz pg_track_settings.2.0.1.tar.gz
    tar -xzvf pg_track_settings.2.0.1.tar.gz
    cd pg_track_settings-2.0.1
    make && make install	
    # powa-repository
    psql -d powa
    powa=# create extension pg_track_settings ;
    CREATE EXTENSION
    # Activate the pg_track_settings collection function for the target instance.
    dbpowa=# select powa_activate_extension(1, 'pg_track_settings');
    powa_activate_extension
    -------------------------
    t
    (1 row)

  8. Verify the pg_track_settings plug-in extension.

    Change the value of the autovacuum_analyze_threshold parameter on the target instance to 55. The default value is 50. After about 5 minutes, you can view the modification record on the PoWA, as shown in the following figure.

    The contents in the three boxes in the preceding figure are as follows:

    • The time when pg_track_settings is activated and the database parameter value at that time.
    • The time when the autovacuum_analyze_threshold parameter is modified, its original value, and changed value.
    • The time when pg_track_settings is canceled and the database parameter value at that time.