Skip to main content
Question

How to get column sizes for single daily partition

  • January 2, 2023
  • 2 replies
  • 8 views

Sergey_Cherepan_1
Forum|alt.badge.img+2

Hi,

System view COLUMNS gives sizes of columns for whole table.

I am trying to find size of columns for single daily partition (before daily partitions grouped into monthly or yearly by GROUP BY).

I am pretty sure I need to use low-level system views VS_* to get this info.

I look through system views definitions and I cannot figure it out.

Would you mind to post here how to get size of columns per partition per table.

A big bonus would be if I can find size of columns for a partition group (monthly or yearly), but probably it is too much to ask.

Thank you.

2 replies

mosheg
Forum|alt.badge.img+2
  • Participating Frequently
  • January 2, 2023

Check the table PARTITION_COLUMNS as shown here:
https://www.vertica.com/docs/12.0.x/HTML/Content/Authoring/SQLReferenceManual/SystemTables/MONITOR/PARTITION_COLUMNS.htm

E.g.

SELECT NODE_NAME, PROJECTION_NAME, COLUMN_NAME, GROUPED_PARTITION_KEY, PARTITION_KEY,
SUM(DISK_SPACE_BYTES) as DISK_SPACE_BYTES,
SUM(ROW_COUNT) as ROW_COUNT,
SUM(DELETED_ROW_COUNT) AS DELETED_ROW_COUNT
FROM PARTITION_COLUMNS
WHERE TABLE_NAME IN ('Your_Table_Name')
GROUP BY 1,2,3,4,5
ORDER BY 1,2,3,4,5;

Sergey_Cherepan_1
Forum|alt.badge.img+2
  • Author
  • Participating Frequently
  • January 3, 2023

Great!
That is exactly what I need.
Column group_partition_key is great! I am not sure why it is not present in PARTITIONS table, that is definitely oversight.

Will try to use it, will let you know how it goes.