Configure parameters
This topic describes how to configure PolarDB parameters. You can modify parameters in the PolarDB console, or modify parameters through a client.
Modify parameters in the console
- Log on to the PolarDB console.
-
In the upper-left corner, select the region where the cluster is deployed.
-
Find the target cluster and click its ID.
-
In the left-side navigation pane, choose .
-
Click Modify Parameters.
-
Modify the cluster parameters and click Submit.
-
In the dialog box that appears, click OK.
For more information, see Configure cluster parameters.
Modify parameters through a client
You can use the following commands to modify parameters through a client:
|
Command |
Description |
|
|
Modifies parameters at the database level. Different databases can have different parameter configurations. A session reconnection is required for changes to take effect. |
|
|
Modifies parameters at the user level. Different users can have different parameters. User-level parameters override database-level parameters. A session reconnection is required for changes to take effect. |
|
|
Modifies parameters at the session level. Changes take effect only for the current session. If the session is disconnected, the changes are lost. |
Examples:
-
alter databasetest1=> alter database test1 set vacuum_cost_delay =10; ALTER DATABASE -
alter roletest1=> alter role test1 pg_db_role_setting; setdatabase | setrole | setcofig ------------+---------+------------------------ 41891 | 0 | {vacuum_cost_delay=10} 0 | 41284 | {random_page_cost=10} (2 rows) -
settest1=> set random_page_cost=100; SET test1=> show random_page_cost; random_page_cost ------------------ 100 (1 row)