STL_SCHEMA_QUOTA_VIOLATIONS - Amazon Redshift

STL_SCHEMA_QUOTA_VIOLATIONS

Records the occurrence, timestamp, XID, and other useful information when a schema quota is exceeded.

Superusers can see all the records. Schema owners can only see records related to the schemas they own.

Table columns

Column name Data type Description
ownerid integer The ID of the schema owner.
xid bigint The transaction ID associated with the statement.
pid integer The process ID associated with the statement.
userid integer The ID of the user who generated the entry.
schema_id integer The namespace or schema ID.
schema_name character (128) The namespace or schema name.
quota integer The amount of disk space (in MB) that the schema can use.
disk_usage integer The disk space (in MB) that is currently used by the schema.
disk_usage_pct double precision The disk space percentage that is currently used by the schema out of the configured quota.
timestamp timestamp without time zone The time when the violation occurred.

Sample queries

The following query shows the result of quota violation:

SELECT userid, TRIM(SCHEMA_NAME) "schema_name", quota, disk_usage, disk_usage_pct, timestamp FROM stl_schema_quota_violations WHERE SCHEMA_NAME = 'sales_schema' ORDER BY timestamp DESC;

This query returns the following sample output for the specified schema:

userid | schema_name | quota | disk_usage | disk_usage_pct |timestamp -------+--------------+-------+------------+----------------+---------------------------- 104 | sales_schema | 2048 | 2798 | 136.62 | 2020-04-20 20:09:25.494723 (1 row)