CREATE RESOURCE POOL
Creates a custom resource pool and sets one or more resource pool parameters.
Syntax
CREATE RESOURCE POOL pool‑name [ FOR { SUBCLUSTER subcluster-name | CURRENT SUBCLUSTER } ] [ parameter‑name setting ]…
Parameters
pool‑name |
The name of the resource pool. Built-in pool names cannot be used for user-defined pools. If you specify a resource pool name with uppercase letters, Vertica converts them to lowercase letters. |
[ SUBCLUSTER subcluster-name | CURRENT SUBCLUSTER ] |
Eon Mode only. Specifies the subcluster that you are creating the resource pool for. When omitted, the resource pool is created globally. Attempting to create a global resource pool that has the same name as a subcluster-specific resource pool returns an error.
|
parameter‑name | The parameter to set, listed below. |
setting |
The value to set on parameter‑name. To reset this parameter to its default value, specify Default values specified in this table pertain only to user-defined resource pools. For built-in pool default values, see Built-In Resource Pools Configuration, or query system table |
CASCADE TO |
Specifies a secondary resource pool for executing queries that exceed the CASCADE TO secondary‑pool
|
CPUAFFINITYMODE |
Specifies whether the resource pool has exclusive or shared use of the CPUs specified in CPUAFFINITYMODE { SHARED | EXCLUSIVE | ANY }
|
CPUAFFINITYSET |
Specifies which CPUs are available to this resource pool. All cluster nodes must have the same number of CPUs. The CPU resources assigned to this set are unavailable to general resource pools. CPUAFFINITYSET {
|
EXECUTIONPARALLELISM |
Limits the number of threads used to process any single query issued in this resource pool. EXECUTIONPARALLELISM { limit | AUTO }
|
MAXCONCURRENCY |
Sets the maximum number of concurrent execution slots available to the resource pool, across the cluster: MAXCONCURRENCY { integer | NONE }
|
MAXMEMORYSIZE |
The maximum size per node the resource pool can grow by borrowing memory from the MAXMEMORYSIZE { 'integer%' | 'integer{K|M|G|T}' | NONE }
|
MAXQUERYMEMORYSIZE |
The maximum amount of memory that this pool can allocate at runtime to process a query. If the query requires more memory than this setting, Vertica stops execution and returns an error. Set this parameter as follows: MAXQUERYMEMORYSIZE { 'integer%' | 'integer{K|M|G|T}' | NONE }
|
MEMORYSIZE |
The amount of total memory available to the Vertica resource manager that is allocated to this pool per node: MEMORYSIZE { 'integer%' | 'integer{K|M|G|T}' }
Default: 0%. No memory allocated, the resource pool borrows memory from the |
PLANNEDCONCURRENCY |
Specifies the preferred number queries to execute concurrently in the resource pool. This setting applies to the entire cluster: PLANNEDCONCURRENCY { num‑queries | AUTO }
For clusters where the number of logical cores differs on different nodes, Change this parameter only after evaluating performance over a period of time. |
PRIORITY |
Specifies priority of queries in this pool when they compete for resources in the PRIORITY { integer | HOLD }
Default: 0 |
QUEUETIMEOUT |
Species how long a request can wait for pool resources before it is rejected: QUEUETIMEOUT { integer | NONE }
Default: 300 seconds |
RUNTIMECAP |
Prevents runaway queries by setting the maximum time a query in the pool can execute. If a query exceeds this setting, it tries to cascade to a secondary pool: RUNTIMECAP { 'interval' | NONE }
To specify a value in days, provide an integer value. To provide a value less than one day, provide the interval in the format If the user or session also has a |
RUNTIMEPRIORITY |
Determines how the resource manager should prioritize dedication of run-time resources (CPU, I/O bandwidth) to queries already running in this resource pool: RUNTIMEPRIORITY { HIGH | MEDIUM | LOW } Default: |
RUNTIMEPRIORITYTHRESHOLD |
Specifies in seconds a time limit in which a query must finish before the resource manager assigns to it the resource pool's RUNTIMEPRIORITYTHRESHOLD seconds
Default: |
SINGLEINITIATOR |
By default, set to false for backward compatibility. Do not change this setting. |
Privileges
Superuser
Examples
This example shows how to create a resource pool with MEMORYSIZE
of 1800 MB.
=> CREATE RESOURCE POOL ceo_pool MEMORYSIZE '1800M' PRIORITY 10; CREATE RESOURCE POOL
Assuming the CEO report user already exists, associate this user with the preceding resource pool using ALTER USER
statement.
=> GRANT USAGE ON RESOURCE POOL ceo_pool to ceo_user; GRANT PRIVILEGE => ALTER USER ceo_user RESOURCE POOL ceo_pool; ALTER USER
Issue the following command to confirm that the ceo_user is associated with the ceo_pool:
=> SELECT * FROM users WHERE user_name ='ceo_user'; -[ RECORD 1 ]-----+-------------------------------------------------- user_id | 45035996273733402 user_name | ceo_user is_super_user | f profile_name | default is_locked | f lock_time | resource_pool | ceo_pool memory_cap_kb | unlimited temp_space_cap_kb | unlimited run_time_cap | unlimited all_roles | default_roles | search_path | "$user", public, v_catalog, v_monitor, v_internal
This example shows how to create and designate secondary resource pools.
=> CREATE RESOURCE POOL rp3 RUNTIMECAP '5 minutes'; => CREATE RESOURCE POOL rp2 RUNTIMECAP '3 minutes' CASCADE TO rp3; => CREATE RESOURCE POOL rp1 RUNTIMECAP '1 minute' CASCADE TO rp2; => SET SESSION RESOURCE_POOL = rp1;
This Eon Mode example confirms the current subcluster name, then creates a resource pool for the current subcluster:
=> SELECT CURRENT_SUBCLUSTER_NAME(); CURRENT_SUBCLUSTER_NAME ------------------------- analytics_1 (1 row) => CREATE RESOURCE POOL dashboard FOR SUBCLUSTER analytics_1; CREATE RESOURCE POOL