cdb_plan_cache
parameter to enable or disable the execution plan cache and the cdb_plan_cache_stats
parameter to query information about cache hits. Note that only accounts with the tencentroot permission can use the two parameters.Parameter | Effective Immediately | Type | Default Value | Valid Values/Value Range | Description |
cdb_plan_cache | Yes | bool | false | true/false | Whether to enable the feature. Only accounts with the feature permission can use the parameter. |
show cdb_plan_cache
command to query information about execution plan cache hits. The command will return the following fields:Field | Description |
sql | A SQL statement with the question mark (?) which represents that the execution plan of this statement has been cached. |
mode | SQL cache mode. Currently, only the prepare mode is supported. |
hit | Number of hits for this session. |
cdb_plan_cache_stats
is enabled, cache hit information will be recorded, affecting database performance.show profile
to show the status at each stage of SQL statement execution. But when the execution plan cache is hit, the status of optimizing
, statistics
, and preparing
will be omitted.
Was this page helpful?