Options

Auditing Flex Tables

Jim_KnicelyJim_Knicely - Select Field - Administrator

The AUDIT_FLEX function returns the estimated ROS size of raw column in a Flex table, equivalent to the export size of the flex data in the audited objects.

Example:

dbadmin=> CREATE FLEX TABLE flex_tables.flex();
CREATE TABLE

dbadmin=> INSERT INTO flex_tables.flex SELECT 1 c1, 1 c2;
OUTPUT
--------
      1
(1 row)

dbadmin=> INSERT INTO flex_tables.flex SELECT 2 c1, 2 c2;
OUTPUT
--------
      1
(1 row)

dbadmin=> INSERT INTO flex_tables.flex SELECT 3 c1, 3 c2;
OUTPUT
--------
      1
(1 row)

dbadmin=> COMMIT;
COMMIT

dbadmin=> SELECT table_name, is_flextable
dbadmin->   FROM tables WHERE Table_name = 'flex';
table_name | is_flextable
------------+--------------
flex       | t
(1 rows)

Note that the AUDIT function returns 0 for a Flex table if no columns in the Flex table have been materialized.

dbadmin=> SELECT audit('flex_tables.flex');
audit
-------
0
(1 row)

Instead, use the AUDIT_FLEX function on Flex tables:

dbadmin=> SELECT audit_flex('flex_tables.flex');
audit_flex
------------
6
(1 row)

Helpful Links:
https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/SQLReferenceManual/Functions/VerticaFunctions/LicenseManagement/AUDIT_FLEX.htm

Have fun!

Sign In or Register to comment.