This topic describes the parameter settings of PolarDB-O. You can modify the parameters in the PolarDB console or on clients.

Modify parameters in the console

  1. Log on to the PolarDB console.
  2. On the top of the page, select the region where the target cluster is located.
  3. Find the target cluster and click the cluster ID to go to the Overview page.
  4. In the left-side navigation pane, choose Settings and Management > Parameters.
  5. In the Current Value column on the page that appears, change the values of one or more parameters. Then, click Apply Changes.
    Apply Changes
  6. In the Save Changes dialog box, click OK.
    Save Changes

For more information, see Change the values of cluster parameters.

Modify parameters on clients

You can execute the following statements to modify parameters on the clients.

Statement Description
alter database Modifies database-level parameters. You can specify different parameter values for different databases. After you modify the parameters, you must reconnect to the session to make new parameter settings to take effect.
alter role Modifies user-level parameters. You can specify different parameter values for different users. The user-level parameter settings override database-level parameter settings. After you modify the parameters, you must reconnect to the session to make new parameter settings to take effect.
set Modifies session-level parameters. The new parameter settings take effect for only the current session. If the session is disconnected, the new parameter settings become invalid.

Examples:

  • alter database
    test1=> alter database test1 set vacuum_cost_delay =10;
    ALTER DATABASE
  • alter role
    test1=> alter role test1 pg_db_role_setting;
     setdatabase | setrole |       setcofig
     ------------+---------+------------------------
           41891 |       0 | {vacuum_cost_delay=10}
           0 |     41284 | {random_page_cost=10}
    (2 rows)
  • set
    test1=> set random_page_cost=100;
    SET
    test1=> show random_page_cost;
     random_page_cost
    ------------------
     100
    (1 row)