ALTER SERVICE ACCOUNT SET MEMORY LIMIT reference
RBAC provides fine-grained database permissions management.
ALTER SERVICE ACCOUNT ... SET MEMORY LIMIT caps the native memory each of the
service account's queries may allocate.
Syntax
ALTER SERVICE ACCOUNT serviceAccountName SET MEMORY LIMIT { size | UNLIMITED };
Description
ALTER SERVICE ACCOUNT serviceAccountName SET MEMORY LIMIT sizecaps the native memory each of the service account's queries may allocate.sizeis a byte count or a size with aK,M, orGsuffix, such as512Mor2G.ALTER SERVICE ACCOUNT serviceAccountName SET MEMORY LIMIT UNLIMITEDclears the service account's limit. The workload limit (cairo.query.memory.limit.bytes) then applies.SET MEMORY LIMIT 0does the same.
A user who assumes the service account runs under its memory limit. No group limit can apply, because a service account cannot belong to an ACL group, so either it has a limit of its own or only the workload limit applies.
Setting it requires the SET MEMORY LIMIT permission. See
memory limits for how the limit interacts
with the
cairo.query.memory.limit.bytes
workload limit.
This is a per-query ceiling. To bound what a whole workload may hold at once instead, use a resource group.
Examples
-- cap the service account's queries at 1 GiB of native memory
ALTER SERVICE ACCOUNT client_app SET MEMORY LIMIT 1G;
-- remove the limit
ALTER SERVICE ACCOUNT client_app SET MEMORY LIMIT UNLIMITED;
The configured value can be verified with
SHOW SERVICE ACCOUNTS, which
reports it in the memory_limit column.