此视图是为了向后兼容而存在的。检索压缩信息的受支持视图是
- timescaledb_information.hypertable_compression_settings
- timescaledb_information.chunk_compression_settings.
弃用
本节介绍 Timescale 上已弃用的功能。我们强烈建议您不要在生产环境中使用此功能。如果您需要更多信息,请联系我们。
获取有关 hypertables 压缩相关设置的信息。视图的每一行都提供有关压缩使用的各个 orderby
和 segmentby
列的信息。
您如何使用 segmentby
是压缩最重要的事情。它影响压缩率、查询性能以及可变压缩压缩或解压缩的内容。
名称 | 类型 | 描述 |
---|---|---|
hypertable_schema | TEXT | hypertable 的模式名称 |
hypertable_name | TEXT | hypertable 的表名 |
attname | TEXT | 压缩设置中使用的列的名称 |
segmentby_column_index | SMALLINT | attname 在 compress_segmentby 列表中的位置 |
orderby_column_index | SMALLINT | attname 在 compress_orderby 列表中的位置 |
orderby_asc | BOOLEAN | 如果用于按 ASC 排序,则为 True;如果用于按 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 的新增功能。
关键词
在此页面上发现问题?报告问题 或 在 GitHub 上编辑此页面。