Timescale Cloud:性能、规模、企业级
自托管产品
MST
此视图是为了向后兼容而存在的。获取压缩信息的受支持视图是
- timescaledb_information.hypertable_compression_settings
- timescaledb_information.chunk_compression_settings.
弃用
本节描述了 Timescale 中已弃用的功能。我们强烈建议您不要在生产环境中使用此功能。如果您需要更多信息,请联系我们。
获取有关超表压缩相关设置的信息。视图的每一行都提供有关压缩使用的各个 orderby
和 segmentby
列的信息。
如何使用 segmentby
对压缩至关重要。它影响压缩率、查询性能以及可变压缩所压缩或解压缩的内容。
名称 | 类型 | 描述 |
---|---|---|
hypertable_schema | TEXT | 超表的模式名称 |
hypertable_name | TEXT | 超表的表名称 |
attname | TEXT | 压缩设置中使用的列名称 |
segmentby_column_index | SMALLINT | attname 在 compress_segmentby 列表中的位置 |
orderby_column_index | SMALLINT | attname 在 compress_orderby 列表中的位置 |
orderby_asc | BOOLEAN | 如果用于 order by ASC 则为 True,如果用于 order by DESC 则为 False |
orderby_nullsfirst | BOOLEAN | 如果此列的 null 值优先排序则为 True,如果 null 值最后排序则为 False |
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
注意
by_range
维度构建器是 TimescaleDB 2.13 的新增功能。
关键词