HomeMogDBMogDB StackUqbar
v5.0

Documentation:v5.0

Supported Versions:

Other Versions:

Backend Compression Parameters

The system starts backend compression threads to perform compression operations on compression tables.

Backend Compression

autocmpr_max_workers

Parameter description: specifies the maximum number of backend compression threads that can run concurrently.

This parameter is a POSTMASTER parameter. Set it based on instructions provided in Table 2 Methods for setting GUC parameters.

Value range: integer with a minimum value of 0 (no background compression), a theoretical maximum value of 262143, and a dynamic maximum value in practice. The formula is "262143 - value of max_connections - value of job_queue_processes - number of helper threads - number of background compressed launcher threads - 1", where the number of helper threads is set by the macro definition, the default value of the current version is 20, and the number of background compressed launcher threads is fixed to 1.

Default value: 3

autocmpr_naptime

Parameter description: specifies the time interval of the operations of setting backend compression.

This parameter is a SIGHUP parameter. Set it based on instructions provided in Table 2 Methods for setting GUC parameters.

Value range: integer, the unit is second. The minimum value is 1, and the maximum value is 604800.

Default value: 300s

imgNote:

  • The unit can be specified as h, min, or s (default) if you modify it by running gs_guc.
  • The unit can be specified as h, min, or s (default) if you modify it by editing the postgresql.conf file.
  • The unit cannot be specified and the default one is s if the parameter is modified by running ALTER SYSTEM SET autocmpr_naptime TO value.

Cost-based Row-level Compression

The row-level compression feature of MogDB uses an overhead-based flow control mechanism to reduce the impact of background compression on database I/O as much as possible. For example, background compression does not need to be done quickly, and it does not want to seriously affect the performance of other database operations. Overhead-based background compression provides a means for database administrators to achieve this goal.

Background information: During the compression task execution, the system maintains an internal counter that tracks the approximate overhead of various I/O operations during compression. If the accumulated cost reaches the limit declared by compress_cost_limit, the thread that initiated the compression task will sleep for the amount of time specified by compress_cost_delay, then the system will reset the counter and continue the compression task.

compress_cost_limit

Parameter description: sets a cost limit for the thread that initiates the compression task.

This parameter is a USERSET parameter. Set it based on instructions provided in Table 2 Methods for setting GUC parameters.

Value range: integer. The minimum value is 1, and the maximum value is 10000.

Default value: 200

compress_cost_delay

Parameter description: specifies the time that the compressing task thread sleeps when the cost of compressing a task exceeds this value.

This parameter is a USERSET parameter. Set it based on instructions provided in Table 2 Methods for setting GUC parameters.

Note that in many systems, the effective resolution for sleep time is 10 ms. So setting compress_cost_delay to something other than a multiple of 10 has the same effect as setting it to the next 10.

The value of this parameter is generally set to a small value, which is commonly set to 10 or 20 ms. When tuning row-level compression feature resource usage, it is better to tune other parameters than this one.

Value range: integer. The unit is ms. The minimum value is 0, and the maximum value is 100.

Default value: 0

imgNote: Compression tasks in MogDB include foreground compression and background compression. The foreground compression is mainly triggered by three operations: COPY, VACUUM FULL and CLUSTER, and this parameter affects the execution time of the business operation that triggers the foreground compression task. Since the above three operations are expected to be performed as quickly as possible, compress_cost_delay is set to 0 by default.

autocmpr_cost_limit

Parameter description: sets the cost limit of backend compression threads.

This parameter is a SIGHUP parameter. Set it based on instructions provided in Table 2 Methods for setting GUC parameters.

Value range: integer. The minimum value is -1, and the maximum value is 10000. -1 indicates that the value of compress_cost_limit is used.

Default value: -1

autocmpr_cost_delay

Parameter description: sets the cost delay of backend compression threads.

This parameter is a SIGHUP parameter. Set it based on instructions provided in Table 2 Methods for setting GUC parameters.

Value range: integer. The unit is ms. The minimum value is -1, and the maximum value is 100. -1 indicates that the value of compress_cost_delay is used.

Default value: 20

compress_cost_page_hit

Parameter description: obtains a predicted cost of a data page from shared cache. It indicates that a cache pool is locked to query the cost of the shared hash tables.

This parameter is a USERSET parameter. Set it based on instructions provided in Table 2 Methods for setting GUC parameters.

Value range: integer. The minimum value is 0, and the maximum value is 10000.

Default value: 1

compress_cost_page_miss

Parameter description: reads the predicted cost of a data page from a disk. It indicates that a cache pool is locked to query the cost of the shared hash tables and reading data blocks from a disk.

This parameter is a USERSET parameter. Set it based on instructions provided in Table 2 Methods for setting GUC parameters.

Value range: integer. The minimum value is 0, and the maximum value is 10000.

Default value: 10

compress_cost_page_dirty

Parameter description: indicates the predicted cost of compressing a data page. It indicates the cost of flushing the dirty page after a page is scanned and compressed.

This parameter is a USERSET parameter. Set it based on instructions provided in Table 2 Methods for setting GUC parameters.

Value range: integer. The minimum value is 0, and the maximum value is 10000.

Default value: 20

autocompress

Parameter description: Enable the autocopmress sub-process.

This parameter is a SIGHUP parameter. Set it based on instructions provided in Table 2 Methods for setting GUC parameters.

Value range: Boolean

Default value: on

enable_backend_compress

Parameter description: Controls whether background compression is enabled.

This parameter is a SIGHUP parameter. Set it based on instructions provided in Table 2 Methods for setting GUC parameters.

Value range: Boolean

Default value: on

enable_compression_check

Parameter description: Controls whether compression checking is enabled.

This parameter is a POSTMASTER parameter. Set it based on instructions provided in Table 2 Methods for setting GUC parameters.

Value range: Boolean

Default value: on

enable_default_compression_table

Parameter description: Controls whether table building defaults to creating compressed tables.

This parameter is a POSTMASTER parameter. Set it based on instructions provided in Table 2 Methods for setting GUC parameters.

Value range: Boolean

Default value: off

enable_default_index_compression

Parameter description: Controls whether index compression is enabled.

This parameter is a POSTMASTER parameter. Set it based on instructions provided in Table 2 Methods for setting GUC parameters.

Value range: Boolean

Default value: off

enable_page_compression

Parameter description: Controls whether page compression is enabled.

This parameter is a POSTMASTER parameter. Set it based on instructions provided in Table 2 Methods for setting GUC parameters.

Value range: Boolean

Default value: off

Copyright © 2011-2024 www.enmotech.com All rights reserved.