此视图是为了向后兼容而存在的。检索压缩信息的受支持视图是

弃用

本节介绍 Timescale 上已弃用的功能。我们强烈建议您不要在生产环境中使用此功能。如果您需要更多信息,请联系我们

获取有关 hypertables 压缩相关设置的信息。视图的每一行都提供有关压缩使用的各个 orderbysegmentby 列的信息。

您如何使用 segmentby 是压缩最重要的事情。它影响压缩率、查询性能以及可变压缩压缩或解压缩的内容。

名称类型描述
hypertable_schemaTEXThypertable 的模式名称
hypertable_nameTEXThypertable 的表名
attnameTEXT压缩设置中使用的列的名称
segmentby_column_indexSMALLINTattname 在 compress_segmentby 列表中的位置
orderby_column_indexSMALLINTattname 在 compress_orderby 列表中的位置
orderby_ascBOOLEAN如果用于按 ASC 排序,则为 True;如果用于按 DESC 排序,则为 False
orderby_nullsfirstBOOLEAN如果此列的 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 | public
hypertable_name | hypertab
attname | a_col
segmentby_column_index | 1
orderby_column_index |
orderby_asc |
orderby_nullsfirst |
-[ RECORD 2 ]----------+---------
hypertable_schema | public
hypertable_name | hypertab
attname | b_col
segmentby_column_index | 2
orderby_column_index |
orderby_asc |
orderby_nullsfirst |
-[ RECORD 3 ]----------+---------
hypertable_schema | public
hypertable_name | hypertab
attname | c_col
segmentby_column_index |
orderby_column_index | 1
orderby_asc | f
orderby_nullsfirst | t
-[ RECORD 4 ]----------+---------
hypertable_schema | public
hypertable_name | hypertab
attname | d_col
segmentby_column_index |
orderby_column_index | 2
orderby_asc | t
orderby_nullsfirst | f
注意

by_range 维度构建器是 TimescaleDB 2.13 的新增功能。

关键词

在此页面上发现问题?报告问题 或 在 GitHub 上编辑此页面