For AI agents: the complete documentation index is at llms.txt. Every page is also available as markdown by appending .md to its URL, or by sending an Accept: text/markdown request header.

ALTER SERVICE ACCOUNT SET MEMORY LIMIT reference

Enterprise:

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 size caps the native memory each of the service account's queries may allocate. size is a byte count or a size with a K, M, or G suffix, such as 512M or 2G.
  • ALTER SERVICE ACCOUNT serviceAccountName SET MEMORY LIMIT UNLIMITED clears the service account's limit. The workload limit (cairo.query.memory.limit.bytes) then applies. SET MEMORY LIMIT 0 does 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.

See also​