AUDIT_FLEX

Returns the estimated ROS size of __raw__ columns, equivalent to the export size of the flex data in the audited objects. You can audit all flex data in the database, or narrow the audit scope to a specific flex table, projection, or schema. Vertica stores the audit results in system table USER_AUDITS.

The audit excludes the following:

  • Flex keys
  • Other columns in the audited tables.
  • Temporary flex tables

Syntax

AUDIT_FLEX ('[scope]')

Parameters

scope

Specifies the extent of the audit: 

  • Empty string ('') audits all flexible tables in the database.
  • The name of a schema, projection, or flex table.

Privileges

Superuser, or the following privileges:

  • SELECT privilege on the target tables
  • USAGE privilege on the target schemas

If you audit a schema or the database, Vertica only returns the size of all objects that you have privileges to access within the audited object, as described above.

Examples

Audit all flex tables in the current database:

dbs=> select audit_flex('');
audit_flex
------------
8567679
(1 row)

Audit the flex tables in schema public

dbs=> select audit_flex('public');
audit_flex
------------
8567679
(1 row)

Audit the flex data in projection bakery_b0

dbs=> select audit_flex('bakery_b0');
 audit_flex
------------
 8566723
(1 row)

Audit flex table bakery

dbs=> select audit_flex('bakery');
 audit_flex
------------
 8566723
(1 row)

To report the results of all audits saved in the USER_AUDITS, the following shows part of an extended display from the system table showing an audit run on a schema called test, and the entire database, dbs

dbs=> \x
Expanded display is on.

dbs=> select * from user_audits;
-[ RECORD 1 ]-------------------------+------------------------------ size_bytes | 0 user_id | 45035996273704962 user_name | release object_id | 45035996273736664 object_type | SCHEMA object_schema | object_name | test audit_start_timestamp | 2014-02-04 14:52:15.126592-05 audit_end_timestamp | 2014-02-04 14:52:15.139475-05 confidence_level_percent | 99 error_tolerance_percent | 5 used_sampling | f confidence_interval_lower_bound_bytes | 0 confidence_interval_upper_bound_bytes | 0 sample_count | 0 cell_count | 0 -[ RECORD 2 ]-------------------------+------------------------------ size_bytes | 38051 user_id | 45035996273704962 user_name | release object_id | 45035996273704974 object_type | DATABASE object_schema | object_name | dbs audit_start_timestamp | 2014-02-05 13:44:41.11926-05 audit_end_timestamp | 2014-02-05 13:44:41.227035-05 confidence_level_percent | 99 error_tolerance_percent | 5 used_sampling | f confidence_interval_lower_bound_bytes | 38051 confidence_interval_upper_bound_bytes | 38051 sample_count | 0 cell_count | 0 -[ RECORD 3 ]-------------------------+------------------------------ ...