You can adjust database parameters to optimize performance, enhance security, or meet specific feature requirements. PolarDB for PostgreSQL pre-optimizes certain parameters from the community edition to provide good performance and stability in a cloud environment. The following sections provide a complete parameter reference and configuration recommendations for core parameters to assist with parameter tuning.
Important parameters
The default parameter values for PolarDB for PostgreSQL are configured to optimize performance, availability, and reliability. These values may differ from the defaults in the community edition. Specifically, PolarDB sets the following parameters to default values to ensure optimal performance. You can modify them in the console as needed.
Parameter | Description |
| This parameter controls whether a transaction must wait for write-ahead logging (WAL) records to be written to disk before returning a success indicator to the client. Valid values are:
Note Run the |
| This parameter determines how much information is written to the WAL. Valid values are:
Note
|
| This parameter sets the level of the audit log. The default value is ddl, which means only SQL statements corresponding to DDL are audited. Printing fewer logs can improve database performance. Valid values are:
Note
|
Common parameter reference
Some parameters cannot be modified in the console. You can log on to the cluster and use the command line to view and modify them.
Connection and authentication
Parameter | Description |
| Sets the maximum time to wait for a client to complete identity authentication. If the client fails to authenticate within this time, the server closes the connection to prevent problematic clients from occupying connection resources for a long time.
|
| Controls whether the instance enables and supports Secure Sockets Layer (SSL) encryption connections.
|
Autovacuum
The autovacuum process reclaims space occupied by dead tuples (rows from deleted or updated data) and updates table statistics. This process is critical to maintaining database performance.
Parameter | Description |
| Controls whether to enable the
Note Even if this parameter is disabled, the system will still force a vacuum process to start when it is necessary to prevent transaction ID wraparound. |
| Specifies the maximum number of autovacuum worker processes (other than the autovacuum launcher) that can run at the same time.
|
| Specifies the minimum hibernation time for the autovacuum process between checks on a database. In each round, the background process checks the database and issues
|
| The minimum number of changed (inserted, deleted, or updated) tuples required to trigger a
|
| The table size scale factor for triggering a
|
| The minimum number of changed (inserted, deleted, or updated) tuples required to trigger an
|
| The table size scale factor for triggering an
|
| The maximum age that a table's oldest transaction ID can have before a
Note Even if autovacuum is disabled, the system will still initiate autovacuum processes to prevent wraparound. |
| The maximum age that a table's oldest multixact ID can have before a
Note Even if autovacuum is disabled, the system will still initiate autovacuum processes to prevent wraparound. |
| The cost delay time for automatic
|
| The cost limit for automatic
|
Checkpoints and background writing
Parameter | Description |
| Sets the maximum time interval between automatic WAL checkpoints.
|
| The hibernation time for the background writer between two rounds of flushing dirty pages.
|
| When the number of dirty pages written by a background process exceeds this threshold, the operating system flushes data from the file cache to the disk.
|
| Controls whether the entire content of a data page is written to the WAL log when it is first modified after a checkpoint. This feature is used to prevent partial page writes caused by failures such as power outages.
|
| The size of shared memory used to temporarily store WAL data in memory.
|
| Controls the level of information written to the write-ahead logging (WAL). Different levels support different features:
|
| The maximum hibernation time for the walwriter process between two rounds of WAL flush operations.
|
Query planning and execution
Parameter | Description |
| Controls whether the query optimizer uses table constraints (such as CHECK constraints) to optimize queries, especially for query pruning on partitioned tables.
|
| Sets the planner's cost estimation for processing each index entry during an index scan.
|
| Sets the planner's cost estimation for processing each operator or function in a query.
|
| Sets the planner's cost estimation for processing each row in a query.
|
| Controls whether the query optimizer enables partition pruning optimization during the planning and execution phases to skip scanning irrelevant partitions.
|
| Sets the planner's cost estimation for a sequential disk page fetch.
|
| Controls whether to enable Just-In-Time (JIT) compilation for specific queries to accelerate execution.
|
Timeout settings
Parameter | Description |
| The maximum time a transaction waits for a lock before checking for a potential deadlock.
|
| The maximum allowed time for a transaction to be in an "idle in transaction" state. The session is terminated if this time is exceeded. Set to 0 to disable this timeout.
|
| The maximum time a single operation waits to acquire a lock on a table, row, or other object. The operation exits with an error if this time is exceeded. Set to 0 to disable this timeout, which means it will wait indefinitely.
|
| Limits the maximum execution time for a single SQL statement. The statement is terminated if this time is exceeded. Set to 0 for no timeout limit.
|
Logging and auditing
Parameter | Description |
| Controls whether to enable the log collection process, which is responsible for catching and writing logs during cluster operation.
|
| Controls whether to record each successful client connection in the log.
|
| Controls whether to record each client disconnection in the log.
|
| Sets the verbosity of the error log.
|
| Records slow SQL statements that exceed a specified running time threshold. Set to 0 to record all SQL statements. Set to -1 to disable the slow SQL statement log feature.
|
| Controls the type of SQL statements recorded in the log.
|
Replication and high availability
Parameter | Description |
| Controls whether a secondary node (read-only node) can accept read-only queries.
|
| Controls whether a read-only node sends feedback to the primary node about its running queries. When enabled, the primary node delays cleaning up old data rows that are still being used by queries on the read-only node to reduce query conflicts.
|
| The maximum number of replication slots that the instance can support.
|
Resource management
Parameter | Description |
| Specifies the implementation method for dynamic shared memory.
|
| Sets the maximum memory size of the pending list for a GIN index in fast update mode.
|
| Controls whether the instance attempts to use large pages provided by the operating system.
|
| The maximum number of file handles that each database background process is allowed to open simultaneously.
|
| The maximum number of locks that each transaction can hold.
|
| The maximum number of transactions that can be in the prepared state (two-phase commit protocol) at the same time in the cluster.
|
| The maximum total number of background worker processes that the cluster can start, including parallel query worker processes.
|
| Limits the total size of temporary files (used for operations such as sorting and hashing) that a single background process can use. Set to -1 for no limit.
|
Formatting and behavior
Parameter | Description |
| Sets the display format for date and time values.
|
| A deprecated parameter that controlled whether |
| Controls the number of extra significant digits displayed for floating-point numbers beyond the standard precision. This is used to display floating-point values more accurately.
|
| Controls whether the database forces data changes to be synchronized from the operating system cache to the physical disk after critical operations, such as
|
| Specifies the time zone that the database session uses to display and interpret timestamps.
|