Top
Enterprise Postgres 17 SP1 Installation and Setup Guide for Server

4.7.4 pg_dbms_stats

4.7.4.1 Setting Up pg_dbms_stats

  1. Set the postgresql.conf file parameter.
    Add "pg_dbms_stats" to the "shared_preload_libraries" parameter.

  2. As superuser, run the following command:

    $ su -
    Password:******
    # cp -r /opt/fsepv<x>server64/OSS/pg_dbms_stats/* /opt/fsepv<x>server64
  3. Restart Fujitsu Enterprise Postgres.

  4. Run CREATE EXTENSION for the database that will use this feature.
    The target database is described as "postgres" here.
    Use the psql command to connect to the "postgres" database.

    postgres=# CREATE EXTENSION pg_dbms_stats;
    CREATE EXTENSION

    See

    Refer to "Enhanced Query Plan Stability" in the Operation Guide for details.

4.7.4.2 Removing pg_dbms_stats

Unsetting pg_dbms_stats causes statistics managed by pg_dbms_stats to be lost. Therefore, if you plan to use pg_dbms_stats again later, back up each table in each database's dbms_stats schema in binary format, as shown below, and then perform unsetup.

postgres › # COPY <dbms_stats Schema's table name> TO '<Filename>' FORMAT binary;
  1. Execute DROP EXTENSION for the database that will use this feature.
    Use the psql command to connect to the "postgres" database.

    postgres=# DROP EXTENSION pg_dbms_stats CASCADE;
    DROP EXTENSION
  2. As superuser, run the following command:

    $ su -
    Password:******
    # rm -rf /opt/fsepv<x>server64/filesCopiedDuringSetup

    Information

    The files copied during setup can be checked below.

    # find /opt/fsepv<x>server64/OSS/pg_dbms_stats
  3. Set the postgresql.conf file parameters.
    Delete "pg_dbms_stats" to the shared_preload_libraries parameter.

  4. Restart Fujitsu Enterprise Postgres.