mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-21 13:14:19 +08:00
Use chunk status for is_compressed field in view
The timescaledb_information.chunks view used to return NULL in the is_compressed field for distributed chunks. This changes the view to always return true or false, depending on the chunk status flags in the Access Node. This is a hint and cannot be used as a source of truth for the compression state of the actual chunks in the Data Nodes.
This commit is contained in:
parent
45384357bd
commit
adde40f548
@ -206,12 +206,10 @@ FROM (
|
|||||||
ELSE
|
ELSE
|
||||||
dimsl.range_end
|
dimsl.range_end
|
||||||
END AS integer_range_end,
|
END AS integer_range_end,
|
||||||
CASE WHEN node_list IS NULL THEN
|
CASE WHEN (srcch.status & 1 = 1) THEN --distributed compress_chunk() has definitely been called
|
||||||
CASE WHEN srcch.compressed_chunk_id IS NOT NULL THEN
|
--remote chunk compression status still uncertain
|
||||||
TRUE
|
TRUE
|
||||||
ELSE FALSE
|
ELSE FALSE --remote chunk compression status uncertain
|
||||||
END
|
|
||||||
ELSE NULL --distributed chunk case
|
|
||||||
END AS is_compressed,
|
END AS is_compressed,
|
||||||
pgtab.spcname AS chunk_table_space,
|
pgtab.spcname AS chunk_table_space,
|
||||||
chdn.node_list
|
chdn.node_list
|
||||||
|
@ -379,7 +379,7 @@ range_start | Wed Feb 28 16:00:00 2018 PST
|
|||||||
range_end | Wed Mar 07 16:00:00 2018 PST
|
range_end | Wed Mar 07 16:00:00 2018 PST
|
||||||
range_start_integer |
|
range_start_integer |
|
||||||
range_end_integer |
|
range_end_integer |
|
||||||
is_compressed |
|
is_compressed | f
|
||||||
chunk_tablespace |
|
chunk_tablespace |
|
||||||
data_nodes | {db_dist_compression_1,db_dist_compression_2}
|
data_nodes | {db_dist_compression_1,db_dist_compression_2}
|
||||||
-[ RECORD 2 ]----------+----------------------------------------------
|
-[ RECORD 2 ]----------+----------------------------------------------
|
||||||
@ -393,7 +393,7 @@ range_start | Wed Feb 28 16:00:00 2018 PST
|
|||||||
range_end | Wed Mar 07 16:00:00 2018 PST
|
range_end | Wed Mar 07 16:00:00 2018 PST
|
||||||
range_start_integer |
|
range_start_integer |
|
||||||
range_end_integer |
|
range_end_integer |
|
||||||
is_compressed |
|
is_compressed | f
|
||||||
chunk_tablespace |
|
chunk_tablespace |
|
||||||
data_nodes | {db_dist_compression_2,db_dist_compression_3}
|
data_nodes | {db_dist_compression_2,db_dist_compression_3}
|
||||||
-[ RECORD 3 ]----------+----------------------------------------------
|
-[ RECORD 3 ]----------+----------------------------------------------
|
||||||
@ -407,7 +407,7 @@ range_start | Wed Feb 28 16:00:00 2018 PST
|
|||||||
range_end | Wed Mar 07 16:00:00 2018 PST
|
range_end | Wed Mar 07 16:00:00 2018 PST
|
||||||
range_start_integer |
|
range_start_integer |
|
||||||
range_end_integer |
|
range_end_integer |
|
||||||
is_compressed |
|
is_compressed | f
|
||||||
chunk_tablespace |
|
chunk_tablespace |
|
||||||
data_nodes | {db_dist_compression_1,db_dist_compression_3}
|
data_nodes | {db_dist_compression_1,db_dist_compression_3}
|
||||||
|
|
||||||
|
@ -77,9 +77,9 @@ SELECT * from timescaledb_information.chunks
|
|||||||
ORDER BY hypertable_name, chunk_name;
|
ORDER BY hypertable_name, chunk_name;
|
||||||
hypertable_schema | hypertable_name | chunk_schema | chunk_name | primary_dimension | primary_dimension_type | range_start | range_end | range_start_integer | range_end_integer | is_compressed | chunk_tablespace | data_nodes
|
hypertable_schema | hypertable_name | chunk_schema | chunk_name | primary_dimension | primary_dimension_type | range_start | range_end | range_start_integer | range_end_integer | is_compressed | chunk_tablespace | data_nodes
|
||||||
-------------------+-----------------+-----------------------+-----------------------+-------------------+--------------------------+------------------------------+------------------------------+---------------------+-------------------+---------------+------------------+---------------------------
|
-------------------+-----------------+-----------------------+-----------------------+-------------------+--------------------------+------------------------------+------------------------------+---------------------+-------------------+---------------+------------------+---------------------------
|
||||||
public | dist_table | _timescaledb_internal | _dist_hyper_1_1_chunk | time | timestamp with time zone | Wed Feb 28 16:00:00 2018 PST | Wed Mar 07 16:00:00 2018 PST | | | | | {view_node_1,view_node_2}
|
public | dist_table | _timescaledb_internal | _dist_hyper_1_1_chunk | time | timestamp with time zone | Wed Feb 28 16:00:00 2018 PST | Wed Mar 07 16:00:00 2018 PST | | | t | | {view_node_1,view_node_2}
|
||||||
public | dist_table | _timescaledb_internal | _dist_hyper_1_2_chunk | time | timestamp with time zone | Wed Feb 28 16:00:00 2018 PST | Wed Mar 07 16:00:00 2018 PST | | | | | {view_node_2,view_node_3}
|
public | dist_table | _timescaledb_internal | _dist_hyper_1_2_chunk | time | timestamp with time zone | Wed Feb 28 16:00:00 2018 PST | Wed Mar 07 16:00:00 2018 PST | | | f | | {view_node_2,view_node_3}
|
||||||
public | dist_table | _timescaledb_internal | _dist_hyper_1_3_chunk | time | timestamp with time zone | Wed Feb 28 16:00:00 2018 PST | Wed Mar 07 16:00:00 2018 PST | | | | | {view_node_1,view_node_3}
|
public | dist_table | _timescaledb_internal | _dist_hyper_1_3_chunk | time | timestamp with time zone | Wed Feb 28 16:00:00 2018 PST | Wed Mar 07 16:00:00 2018 PST | | | f | | {view_node_1,view_node_3}
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
SELECT * from timescaledb_information.dimensions
|
SELECT * from timescaledb_information.dimensions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user