How to find which compression a column is using? - DuckDB

Home Forums DuckDB How to find which compression a column is using?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #111944

    quantific
    Participant

    How do I find which compression format a table and column within duckdb is using?

    #111945

    admin
    Keymaster

    pragma_storage_info(‘tablename’) returns meta data on the compression for a selected table. e.g.


    PIVOT (SELECT row_group_id, column_name, column_id, segment_type,compression,sum(count) AS c
    FROM pragma_storage_info('stocks') WHERE segment_type != 'VALIDITY' GROUP BY ALL)
    ON compression USING sum(c) AS c GROUP BY column_name,segment_type ORDER BY column_name,segment_type;

    Will pivot the compression etc. out to allow easier viewing like so:

    column_name	segment_type	ALP_c	BitPacking_c	Dictionary_c
    close	DOUBLE	34182458		
    date	DATE		34182458	
    high	DOUBLE	34182458		
    low	DOUBLE	34182458		
    open	DOUBLE	34182458		
    pre	VARCHAR			34182458
    sym	VARCHAR			34182458
    volume	BIGINT		34182458	
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.