This section describes the optimizer cost constants. The cost variables described in this section are measured on an arbitrary scale. Only their relative values matter, therefore scaling them all in or out by the same factor will result in no differences in the optimizer's choices. By default, these cost variables are based on the cost of sequential page fetches, that is, seq_page_cost is conventionally set to 1.0 and the other cost variables are set with reference to the parameter. However, you can use a different scale, such as actual execution time in milliseconds.
Parameter description: Specifies the optimizer's estimated cost of a disk page fetch that is part of a series of sequential fetches.
Type: USERSET
Value range: a floating point number ranging from 0 to DBL_MAX
Default value: 1
Parameter description: Specifies the optimizer's estimated cost of an out-of-sequence disk page fetch.
Type: USERSET
Value range: a floating point number ranging from 0 to DBL_MAX
Default value: 4
Parameter description: Specifies the optimizer's estimated cost of processing each row during a query.
Type: USERSET
Value range: a floating point number ranging from 0 to DBL_MAX
Default value: 0.01
Parameter description: Specifies the optimizer's estimated cost of processing each index entry during an index scan.
Type: USERSET
Value range: a floating point number ranging from 0 to DBL_MAX
Default value: 0.005
Parameter description: Specifies the optimizer's estimated cost of processing each operator or function during a query.
Type: USERSET
Value range: a floating point number ranging from 0 to DBL_MAX
Default value: 0.0025
Parameter description: Specifies the optimizer's assumption about the effective size of the disk cache that is available to a single query.
When setting this parameter you should consider both GaussDB(DWS)'s shared buffer and the kernel's disk cache. Also, take into account the expected number of concurrent queries on different tables, since they will have to share the available space.
This parameter has no effect on the size of shared memory allocated by GaussDB(DWS). It is used only for estimation purposes and does not reserve kernel disk cache. The value is in the unit of disk page. Usually the size of each page is 8192 bytes.
Type: USERSET
Value range: an integer ranging is from 1 to INT_MAX. The unit is 8 KB.
A value greater than the default one may enable index scanning, and a value less than the default one may enable sequence scanning.
Default value: 128 MB
Parameter description: Specifies the query optimizer's estimated cost of creating a Hash table for memory space using Hash join. This parameter is used for optimization when the Hash join estimation is inaccurate.
Type: USERSET
Value range: a floating point number ranging from 0 to DBL_MAX
Default value: 0