|
5 | 5 | -- Config tests |
6 | 6 | ------------------------------------------------------------------- |
7 | 7 | CREATE VIEW settings AS SELECT * FROM _timescaledb_catalog.compression_settings ORDER BY upper(relid::text) COLLATE "C"; |
8 | | -CREATE VIEW compressedcols AS select relname,attname,c.oid as reloid,attnum from pg_attribute a, pg_class c where c.oid=a.attrelid and relname like '%compress_hyper_%chunk' order by c.oid asc, a.attnum asc; |
| 8 | +CREATE VIEW compressedcols AS select h.table_name as relname, a.attname, cs.compress_relid as reloid, a.attnum from _timescaledb_catalog.compression_settings cs join _timescaledb_catalog.chunk ch on cs.relid = format('%I.%I', ch.schema_name, ch.table_name)::regclass join _timescaledb_catalog.hypertable h on ch.hypertable_id = h.id join pg_attribute a on a.attrelid = cs.compress_relid order by cs.compress_relid asc, a.attnum asc; |
9 | 9 | CREATE TABLE t(a int, b int, c int, d int, e int, f int, g int, h int, i int); |
10 | 10 | SELECT create_hypertable('t', 'a'); |
11 | 11 | create_hypertable |
@@ -74,29 +74,29 @@ select relid,compress_relid,segmentby,orderby,orderby_desc,orderby_nullsfirst,in |
74 | 74 |
|
75 | 75 | -- Check the auto generated compressed columns |
76 | 76 | select relname,attname from compressedcols order by 1,2; |
77 | | - relname | attname |
78 | | ---------------------------+------------------------------- |
79 | | - compress_hyper_4_2_chunk | _ts_meta_count |
80 | | - compress_hyper_4_2_chunk | _ts_meta_max_1 |
81 | | - compress_hyper_4_2_chunk | _ts_meta_max_2 |
82 | | - compress_hyper_4_2_chunk | _ts_meta_min_1 |
83 | | - compress_hyper_4_2_chunk | _ts_meta_min_2 |
84 | | - compress_hyper_4_2_chunk | regress-test-bloom_c |
85 | | - compress_hyper_4_2_chunk | regress-test-bloom_ed4b_a_b_c |
86 | | - compress_hyper_4_2_chunk | _ts_meta_v2_first_a |
87 | | - compress_hyper_4_2_chunk | _ts_meta_v2_first_b |
88 | | - compress_hyper_4_2_chunk | _ts_meta_v2_last_a |
89 | | - compress_hyper_4_2_chunk | _ts_meta_v2_last_b |
90 | | - compress_hyper_4_2_chunk | a |
91 | | - compress_hyper_4_2_chunk | b |
92 | | - compress_hyper_4_2_chunk | c |
93 | | - compress_hyper_4_2_chunk | cmax |
94 | | - compress_hyper_4_2_chunk | cmin |
95 | | - compress_hyper_4_2_chunk | ctid |
96 | | - compress_hyper_4_2_chunk | d |
97 | | - compress_hyper_4_2_chunk | tableoid |
98 | | - compress_hyper_4_2_chunk | xmax |
99 | | - compress_hyper_4_2_chunk | xmin |
| 77 | + relname | attname |
| 78 | +---------+------------------------------- |
| 79 | + u | _ts_meta_count |
| 80 | + u | _ts_meta_max_1 |
| 81 | + u | _ts_meta_max_2 |
| 82 | + u | _ts_meta_min_1 |
| 83 | + u | _ts_meta_min_2 |
| 84 | + u | regress-test-bloom_c |
| 85 | + u | regress-test-bloom_ed4b_a_b_c |
| 86 | + u | _ts_meta_v2_first_a |
| 87 | + u | _ts_meta_v2_first_b |
| 88 | + u | _ts_meta_v2_last_a |
| 89 | + u | _ts_meta_v2_last_b |
| 90 | + u | a |
| 91 | + u | b |
| 92 | + u | c |
| 93 | + u | cmax |
| 94 | + u | cmin |
| 95 | + u | ctid |
| 96 | + u | d |
| 97 | + u | tableoid |
| 98 | + u | xmax |
| 99 | + u | xmin |
100 | 100 |
|
101 | 101 | ALTER TABLE u SET (timescaledb.compress_index = 'bloom("a","b","c")'); |
102 | 102 | NOTICE: updated compression settings will only apply to future compressions |
@@ -145,36 +145,36 @@ select relid,compress_relid,segmentby,orderby,orderby_desc,orderby_nullsfirst,in |
145 | 145 | _timescaledb_internal._hyper_5_3_chunk | _timescaledb_internal.compress_hyper_6_4_chunk | | {b_01234567890123456789,a_01234567890123456789} | {f,t} | {f,t} | [{"type": "bloom", "column": ["a_01234567890123456789", "b_01234567890123456789", "c_01234567890123456789", "d_01234567890123456789", "e_01234567890123456789"], "source": "default"}, {"type": "bloom", "column": "c_01234567890123456789", "source": "default"}, {"type": "bloom", "column": "d_01234567890123456789", "source": "default"}, {"type": "bloom", "column": "e_01234567890123456789", "source": "default"}, {"type": "minmax", "column": "b_01234567890123456789", "source": "orderby"}, {"type": "firstlast", "column": "b_01234567890123456789", "source": "orderby"}, {"type": "minmax", "column": "a_01234567890123456789", "source": "orderby"}, {"type": "firstlast", "column": "a_01234567890123456789", "source": "orderby"}] |
146 | 146 |
|
147 | 147 | select relname,attname from compressedcols order by 1,2; |
148 | | - relname | attname |
149 | | ---------------------------+----------------------------------------------------------------- |
150 | | - compress_hyper_6_4_chunk | _ts_meta_count |
151 | | - compress_hyper_6_4_chunk | _ts_meta_max_1 |
152 | | - compress_hyper_6_4_chunk | _ts_meta_max_2 |
153 | | - compress_hyper_6_4_chunk | _ts_meta_min_1 |
154 | | - compress_hyper_6_4_chunk | _ts_meta_min_2 |
155 | | - compress_hyper_6_4_chunk | regress-test-bloom_76d9_a_01234567890123456789_b_01234567890123 |
156 | | - compress_hyper_6_4_chunk | regress-test-bloom_c_01234567890123456789 |
157 | | - compress_hyper_6_4_chunk | regress-test-bloom_d_01234567890123456789 |
158 | | - compress_hyper_6_4_chunk | regress-test-bloom_e_01234567890123456789 |
159 | | - compress_hyper_6_4_chunk | _ts_meta_v2_first_a_01234567890123456789 |
160 | | - compress_hyper_6_4_chunk | _ts_meta_v2_first_b_01234567890123456789 |
161 | | - compress_hyper_6_4_chunk | _ts_meta_v2_last_a_01234567890123456789 |
162 | | - compress_hyper_6_4_chunk | _ts_meta_v2_last_b_01234567890123456789 |
163 | | - compress_hyper_6_4_chunk | a_01234567890123456789 |
164 | | - compress_hyper_6_4_chunk | b_01234567890123456789 |
165 | | - compress_hyper_6_4_chunk | c_01234567890123456789 |
166 | | - compress_hyper_6_4_chunk | cmax |
167 | | - compress_hyper_6_4_chunk | cmin |
168 | | - compress_hyper_6_4_chunk | ctid |
169 | | - compress_hyper_6_4_chunk | d_01234567890123456789 |
170 | | - compress_hyper_6_4_chunk | e_01234567890123456789 |
171 | | - compress_hyper_6_4_chunk | f_01234567890123456789 |
172 | | - compress_hyper_6_4_chunk | g_01234567890123456789 |
173 | | - compress_hyper_6_4_chunk | h_01234567890123456789 |
174 | | - compress_hyper_6_4_chunk | i_01234567890123456789 |
175 | | - compress_hyper_6_4_chunk | tableoid |
176 | | - compress_hyper_6_4_chunk | xmax |
177 | | - compress_hyper_6_4_chunk | xmin |
| 148 | + relname | attname |
| 149 | +---------+----------------------------------------------------------------- |
| 150 | + v | _ts_meta_count |
| 151 | + v | _ts_meta_max_1 |
| 152 | + v | _ts_meta_max_2 |
| 153 | + v | _ts_meta_min_1 |
| 154 | + v | _ts_meta_min_2 |
| 155 | + v | regress-test-bloom_76d9_a_01234567890123456789_b_01234567890123 |
| 156 | + v | regress-test-bloom_c_01234567890123456789 |
| 157 | + v | regress-test-bloom_d_01234567890123456789 |
| 158 | + v | regress-test-bloom_e_01234567890123456789 |
| 159 | + v | _ts_meta_v2_first_a_01234567890123456789 |
| 160 | + v | _ts_meta_v2_first_b_01234567890123456789 |
| 161 | + v | _ts_meta_v2_last_a_01234567890123456789 |
| 162 | + v | _ts_meta_v2_last_b_01234567890123456789 |
| 163 | + v | a_01234567890123456789 |
| 164 | + v | b_01234567890123456789 |
| 165 | + v | c_01234567890123456789 |
| 166 | + v | cmax |
| 167 | + v | cmin |
| 168 | + v | ctid |
| 169 | + v | d_01234567890123456789 |
| 170 | + v | e_01234567890123456789 |
| 171 | + v | f_01234567890123456789 |
| 172 | + v | g_01234567890123456789 |
| 173 | + v | h_01234567890123456789 |
| 174 | + v | i_01234567890123456789 |
| 175 | + v | tableoid |
| 176 | + v | xmax |
| 177 | + v | xmin |
178 | 178 |
|
179 | 179 | -- Make sure the duplicate column detection works for long column names |
180 | 180 | \set ON_ERROR_STOP 0 |
|
0 commit comments