Timescale Cloud:性能、规模、企业级

自托管产品

MST

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

弃用

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

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

如何使用 segmentby 对压缩至关重要。它影响压缩率、查询性能以及可变压缩所压缩或解压缩的内容。

名称类型描述
hypertable_schemaTEXT超表的模式名称
hypertable_nameTEXT超表的表名称
attnameTEXT压缩设置中使用的列名称
segmentby_column_indexSMALLINTattname 在 compress_segmentby 列表中的位置
orderby_column_indexSMALLINTattname 在 compress_orderby 列表中的位置
orderby_ascBOOLEAN如果用于 order by ASC 则为 True,如果用于 order by 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 上编辑此页面