Get column name length distribution in Vertica database

Query below returns distribution of column name lengths (number of characters).

Query

select length(column_name) as col_name_length,
       count(*) as columns,
       count(distinct table_id) as tables
from v_catalog.columns
group by length(column_name)
order by col_name_length desc;

Columns

  • col_name_length - lenght in characters of column name
  • columns - number of columns with this length
  • tables - number of tables that have columns with this name length

Rows

  • One row represents one name lenght (number of characters)
  • Scope of rows: each column length that exists in a database
  • Ordered by length ascending (from 1 to max)

Sample results

Sample column name length distribution in VMart sample database.

Comments are only visible when the visitor has consented to statistics cookies. To see and add comments please accept statistics cookies.
0
There are no comments. Click here to write the first comment.