Get column name length distribution in Vertica database

Bart Gawrych - Dataedo Team Bart Gawrych 2019-10-31

Table of Contents:


    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.

    0
    There are no comments. Click here to write the first comment.

    By continuing to use our website, you consent to the use of cookies in accordance with our Privacy Policy.
    Accept