Setting the Default Resource Pool for a User
The default resource pool of a user is the resource_pool
value that will be set when a user first connects to SingleStoreDB Cloud server. You can set this value when you create a user, or modify this value later. To set this value when creating a user, use the following syntax:
CREATE USER general_user WITH DEFAULT RESOURCE POOL = general;
Run the SHOW USERS
command to see the default pool assigned to each user.
SHOW USERS; **** +--------------------+--------+-------------+------------+-----------------------+ | User | Type | Connections | Is deleted | Default resource pool | +--------------------+--------+-------------+------------+-----------------------+ | 'general_user'@'%' | Native | 0 | | general | | 'root'@'%' | Native | 1 | | | +--------------------+--------+-------------+------------+-----------------------+
If the default resource pool is not explicitly set for the user, the default resource pool for that user is the pool set by the command SET GLOBAL resource_pool = foo
, or default_pool
if the session variable is not set globally. The default resource pool information is also in the information schema table.
SELECT * FROM INFORMATION_SCHEMA.USERS; **** +--------------+------+-------------+------------+---------------------+-----------------------+ | USER | HOST | CONNECTIONS | IS_DELETED | LAST_UPDATED | DEFAULT_RESOURCE_POOL | +--------------+------+-------------+------------+---------------------+-----------------------+ | root | % | 1 | 0 | 2018-06-29 11:51:51 | | | general_user | % | 0 | 0 | 2018-06-29 11:54:38 | general | +--------------+------+-------------+------------+---------------------+-----------------------+
You can also change the default pool of a user using the ALTER USER
command. For more information, see ALTER USER.