PostgreSQL®- postgres.conf Parameter

For the read performance of the NGA queries (dpGetPeriod, dpGetPeriodSplit...), parameters must be changed in the file <PG installation path>/<PG version>/postgres.conf.
Note:
Note that these parameters are set automatically for a PostgreSQL® database backend managed by WinCC OA.
However, set the following parameters for a DBAdmin-managed PostgreSQL® database backend:
Table 1. postgres.conf Parameters
Parameter Description
shared_buffers This parameter determines how much memory is dedicated to the server for caching data. It is recommended to set this to 25% of your total RAM.

As WinCC OA is deployed in range of very small to very big servers, at the first start of a managed NGA project, the available physical RAM size is detected and the shared buffer size is defined by main memory RAM * 0,25.

The shared_buffers parameter must be an integer and can be specified either in MB or in GB unit. e.g.

shared_buffers = 128MB
or
shared_buffers = 2GB
work_mem This setting controls the amount of memory allocated for internal sort operations and hash tables before writing to temporary disk files. Adjust this based on your workload and the number of concurrent connections. Set the parameter
work_mem:
"work_mem = 128MB"
max_parallel_workers_per_gather Parallelizing query execution, which can significantly speed up large, complex queries by distributing the workload across multiple CPU cores. Set the parameter

max_parallel_workers_per_gather:

"max_parallel_workers_per_gather = 4"
max_parallel_workers This parameter sets the maximum number of parallel workers that PostgreSQL® can use. Keep in mind that the combined values of max_parallel_workers_per_gather and max_parallel_maintenance_workers will never exceed the value of max_parallel_workers.

For example, if max_parallel_workers is set to 2, but max_parallel_workers_per_gather and max_parallel_maintenance_workers are both set to 100, the system will still use a maximum of only 2 parallel workers.

By default (for new projects using the default PostgreSQL® database), this value is set to match the number of CPU cores in the system. To improve database performance—especially when running queries across multiple archive groups or executing many queries at the same time, such as when using many statistical functions—you can increase max_parallel_workers.
Important:
However, do not set it higher than the number of CPU cores available on your system.
random_page_cost This parameter helps the query planner estimate the cost of random disk page accesses, which are typically more expensive than sequential accesses due to the additional seek time involved. Set the parameter random_page_cost:
"random_page_cost = 1"
maintenance_work_mem This parameter allocates memory for maintenance tasks, which can help speed up operations like vacuuming and indexing by allowing them to process more data in memory rather than relying on slower disk I/O. Detect also the available physical RAM size and set the parameter to
main memory-RAM * 0,03125 e.g.
"maintenance_work_mem = 1 GB"