Auditing Flex Tables Quick Tip

Posted February 20, 2019 by Jim Knicely, Big Data Solutions Architect, Vertica

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.