Configuring GUC Parameters

To ensure the optimal performance of GaussDB(DWS), you can adjust the GUC parameters in the database.

Parameter Types and Values

Setting GUC Parameters

You can configure GUC parameters in the following ways:

Procedure

The following example shows how to set explain_perf_mode.

  1. View the value of explain_perf_mode.

    1
    2
    3
    4
    5
    SHOW explain_perf_mode;
     explain_perf_mode 
    -------------------
     normal
    (1 row)
    

  2. Set explain_perf_mode.

    Perform one of the following operations:

    • Set a database-level parameter.
      1
      ALTER DATABASE gaussdb SET explain_perf_mode TO pretty;
      

      If the following information is displayed, the setting has been modified.

      ALTER DATABASE

      The setting takes effect in the next session.

    • Set a user-level parameter.
      1
      ALTER USER dbadmin SET explain_perf_mode TO pretty;
      

      If the following information is displayed, the setting has been modified.

      ALTER USER

      The setting takes effect in the next session.

    • Set a session-level parameter.
      1
      SET explain_perf_mode TO pretty;
      

      If the following information is displayed, the setting has been modified.

      SET

  3. Check whether the parameter is correctly set.

    1
    2
    3
    4
    5
    SHOW explain_perf_mode;
     explain_perf_mode
    --------------
     pretty
    (1 row)