Timescale Cloud:性能、扩展、企业级
自托管产品
MST
获取与超表压缩相关的分块特定统计信息。所有大小均以字节为单位。
此函数显示分块的压缩大小,该大小在手动执行 `compress_chunk` 或压缩策略处理分块时计算。插入到已压缩的分块中不会更新压缩大小。有关如何计算分块大小的更多信息,请参阅 `chunks_detailed_size` 部分。
名称 | 类型 | 描述 |
---|---|---|
hypertable | REGCLASS | 超表名称 |
列 | 类型 | 描述 |
---|---|---|
chunk_schema | TEXT | 分块的模式名称 |
chunk_name | TEXT | 分块名称 |
compression_status | TEXT | 分块的当前压缩状态 |
before_compression_table_bytes | BIGINT | 压缩前堆的大小(如果当前未压缩则为 NULL) |
before_compression_index_bytes | BIGINT | 压缩前所有索引的大小(如果当前未压缩则为 NULL) |
before_compression_toast_bytes | BIGINT | 压缩前 TOAST 表的大小(如果当前未压缩则为 NULL) |
before_compression_total_bytes | BIGINT | 压缩前整个分块表(表+索引+TOAST)的大小(如果当前未压缩则为 NULL) |
after_compression_table_bytes | BIGINT | 压缩后堆的大小(如果当前未压缩则为 NULL) |
after_compression_index_bytes | BIGINT | 压缩后所有索引的大小(如果当前未压缩则为 NULL) |
after_compression_toast_bytes | BIGINT | 压缩后 TOAST 表的大小(如果当前未压缩则为 NULL) |
after_compression_total_bytes | BIGINT | 压缩后整个分块表(表+索引+TOAST)的大小(如果当前未压缩则为 NULL) |
node_name | TEXT | 分块所在的节点,仅适用于分布式超表 |
SELECT * FROM chunk_compression_stats('conditions')ORDER BY chunk_name LIMIT 2;-[ RECORD 1 ]------------------+----------------------chunk_schema | _timescaledb_internalchunk_name | _hyper_1_1_chunkcompression_status | Uncompressedbefore_compression_table_bytes |before_compression_index_bytes |before_compression_toast_bytes |before_compression_total_bytes |after_compression_table_bytes |after_compression_index_bytes |after_compression_toast_bytes |after_compression_total_bytes |node_name |-[ RECORD 2 ]------------------+----------------------chunk_schema | _timescaledb_internalchunk_name | _hyper_1_2_chunkcompression_status | Compressedbefore_compression_table_bytes | 8192before_compression_index_bytes | 32768before_compression_toast_bytes | 0before_compression_total_bytes | 40960after_compression_table_bytes | 8192after_compression_index_bytes | 32768after_compression_toast_bytes | 8192after_compression_total_bytes | 49152node_name |
使用 pg_size_pretty
以更易读的格式获取输出。
SELECT pg_size_pretty(after_compression_total_bytes) AS totalFROM chunk_compression_stats('conditions')WHERE compression_status = 'Compressed';-[ RECORD 1 ]--+------total | 48 kB
关键词
此页面有问题?报告问题 或 在 GitHub 中编辑此页面
。