Skip to content

Instantly share code, notes, and snippets.

@galanteh
Last active July 13, 2019 23:43
Show Gist options
  • Save galanteh/44d6f022c00290ea947f520488acf84e to your computer and use it in GitHub Desktop.
Save galanteh/44d6f022c00290ea947f520488acf84e to your computer and use it in GitHub Desktop.
Get the temp table logs from Vertica for Navigator Optimizer
/* Temp table logs */
SELECT anchor_table_schema || '.' || anchor_table_name as TABLE_NAME,
projection_column_count as AVG_ROW_LEN,
SUM(row_count) as NUM_ROWS,
CASE
WHEN row_count<=99999 THEN 'x-small'
WHEN row_count<=999999 THEN 'small'
WHEN row_count<=99999999 THEN 'medium'
WHEN row_count<=999999999 THEN 'large'
WHEN row_count>999999999 THEN 'x-large'
END as ROW_RANGE
FROM v_monitor.projection_storage
GROUP BY anchor_table_schema, anchor_table_name, projection_column_count, row_count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment