This view exists for backwards compatibility. The supported views to retrieve information about compression are:
- timescaledb_information.hypertable_compression_settings
- timescaledb_information.chunk_compression_settings.
Deprecation
This section describes a feature that is deprecated on Timescale. We strongly recommend that you do not use this feature in a production environment. If you need more information, contact us.
Get information about compression-related settings for hypertables.
Each row of the view provides information about individual orderby
and segmentby
columns used by compression.
How you use segmentby
is the single most important thing for compression. It
affects compresion rates, query performance, and what is compressed or
decompressed by mutable compression.
Name | Type | Description |
---|---|---|
hypertable_schema | TEXT | Schema name of the hypertable |
hypertable_name | TEXT | Table name of the hypertable |
attname | TEXT | Name of the column used in the compression settings |
segmentby_column_index | SMALLINT | Position of attname in the compress_segmentby list |
orderby_column_index | SMALLINT | Position of attname in the compress_orderby list |
orderby_asc | BOOLEAN | True if this is used for order by ASC, False for order by DESC |
orderby_nullsfirst | BOOLEAN | True if nulls are ordered first for this column, False if nulls are ordered last |
CREATE TABLE hypertab (a_col integer, b_col integer, c_col integer, d_col integer, e_col integer);SELECT table_name FROM create_hypertable('hypertab', by_range('a_col', 864000000));ALTER TABLE hypertab SET (timescaledb.compress, timescaledb.compress_segmentby = 'a_col,b_col',timescaledb.compress_orderby = 'c_col desc, d_col asc nulls last');SELECT * FROM timescaledb_information.compression_settings WHERE hypertable_name = 'hypertab';-[ RECORD 1 ]----------+---------hypertable_schema | publichypertable_name | hypertabattname | a_colsegmentby_column_index | 1orderby_column_index |orderby_asc |orderby_nullsfirst |-[ RECORD 2 ]----------+---------hypertable_schema | publichypertable_name | hypertabattname | b_colsegmentby_column_index | 2orderby_column_index |orderby_asc |orderby_nullsfirst |-[ RECORD 3 ]----------+---------hypertable_schema | publichypertable_name | hypertabattname | c_colsegmentby_column_index |orderby_column_index | 1orderby_asc | forderby_nullsfirst | t-[ RECORD 4 ]----------+---------hypertable_schema | publichypertable_name | hypertabattname | d_colsegmentby_column_index |orderby_column_index | 2orderby_asc | torderby_nullsfirst | f
Note
The by_range
dimension builder is an addition to TimescaleDB 2.13.
Keywords
Found an issue on this page?Report an issue or Edit this page in GitHub.