Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.2.1 |  CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 

Query Cache-Related Parameters

The following are parameters related to the query cache functionality that provides execution results cached for the same SELECT statement. The type and value range for each parameter are as follows:

Parameter Name

Type

Default Value

Min

Max

max_plan_cache_entries

int

1,000

 

 

max_query_cache_entries

int

-1

 

 

query_cache_mode

int

0

0

2

query_cache_size_in_pages

int

-1

 

 

max_plan_cache_entries

max_plan_cache_entries is a parameter that configures the maximum number of query plans to be cached in the memory. If the max_plan_cache_entries parameter is configured to -1 or 0, generated query plans are not stored in the memory cache; if it is configured to an integer value equal to or greater than 1, a specified number of query plans are cached in the memory. Also, the value of this parameter must be configured to an integer value equal to or greater than 1 to use the query cache functionality that caches the results of the same query.

max_query_cache_entries

max_query_cache_entries is a parameter that configures the maximum number of query results to be cached. If the parameter is configured to -1 or 0, the query cache functionality is deactivated; if it is configured to an integer value equal to or greater than 1, the execution results of a specified number of queries are cached. With the query cache functionality, you can expect performance improvement in cases where query data does not change, and the same query is entered repeatedly. Note that the query cache functionality is activated only when the max_plan_cache_entries parameter, which activates the query plan cache functionality, is configured to an integer value equal to or greater than 1 because the query cache functionality is dependent of the query plan cache functionality.

query_cache_mode

query_cache_mode is a parameter that specifies one of two query cache modes. In the primary query cache mode, all queries are cached. In the second query cache mode, the query with the hint /*+QUERY_CACHE(1) */ is only cached. If this parameter is configured to 0, which is the default value, the query cache functionality is deactivated. If it is configured to 1, the functionality is executed in the primary query cache mode. If it is configured to 2, it is executed in the secondary query cache mode. To activate the query cache functionality, configure max_plan_cache_entries, max_query_cache_entries and query_cache_mode parameters equal to or greater than 1 respectively. Note that the query cache functionality is deactivated if any of these parameters does not satisfy the condition.

// The following is an example of caching up to 1,000 for query plans, caching up to 100 for query results.

max_plan_cache_entries=1000

max_query_cache_entries=100

query_cache_mode=1

// The configured values for the two parameters are invalid because the plan cache functionality is deactivated.

max_plan_cache_entries=-1

max_query_cache_entries=100

query_cache_mode=1

// The plan cache functionality is executed for up to 1,000 query plans, and the query cache functionality is deactivated.

max_plan_cache_entries=1000

max_query_cache_entries=100

query_cache_mode=0

query_cache_size_in_pages

query_cache_size_in_pages is a parameter that specifies the number of pages of query results to be cached. A query is cached only when its results are within the specified page size. If the parameter is configured to -1, which is the default value, the query cache functionality is executed for all queries without any constraints for the size of the result page.