@@ -23,12 +23,12 @@ select count(compress_chunk(x)) from show_chunks('sparse') x;
23
23
1
24
24
(1 row)
25
25
26
- explain select * from sparse where value = 1;
26
+ explain (costs off) select * from sparse where value = 1;
27
27
QUERY PLAN
28
28
-------------------------------------------------------------------------------------------------------------------------
29
- Custom Scan (DecompressChunk) on _hyper_1_1_chunk (cost=0.27..20.20 rows=76000 width=12)
29
+ Custom Scan (DecompressChunk) on _hyper_1_1_chunk
30
30
Vectorized Filter: (value = '1'::double precision)
31
- -> Seq Scan on compress_hyper_2_2_chunk (cost=0.00..20.20 rows=76 width=76)
31
+ -> Seq Scan on compress_hyper_2_2_chunk
32
32
Filter: ((_ts_meta_v2_min_value <= '1'::double precision) AND (_ts_meta_v2_max_value >= '1'::double precision))
33
33
(4 rows)
34
34
@@ -40,12 +40,12 @@ select count(compress_chunk(decompress_chunk(x))) from show_chunks('sparse') x;
40
40
1
41
41
(1 row)
42
42
43
- explain select * from sparse where value = 1;
44
- QUERY PLAN
45
- --------------------------------------------------------------------------------------------
46
- Custom Scan (DecompressChunk) on _hyper_1_1_chunk (cost=0.02..17.80 rows=780000 width=12)
43
+ explain (costs off) select * from sparse where value = 1;
44
+ QUERY PLAN
45
+ ------------------------------------------------------
46
+ Custom Scan (DecompressChunk) on _hyper_1_1_chunk
47
47
Vectorized Filter: (value = '1'::double precision)
48
- -> Seq Scan on compress_hyper_2_3_chunk (cost=0.00..17.80 rows=780 width=76)
48
+ -> Seq Scan on compress_hyper_2_3_chunk
49
49
(3 rows)
50
50
51
51
reset timescaledb.auto_sparse_indexes;
@@ -55,33 +55,33 @@ select count(compress_chunk(decompress_chunk(x))) from show_chunks('sparse') x;
55
55
1
56
56
(1 row)
57
57
58
- explain select * from sparse where value = 1;
58
+ explain (costs off) select * from sparse where value = 1;
59
59
QUERY PLAN
60
60
-------------------------------------------------------------------------------------------------------------------------
61
- Custom Scan (DecompressChunk) on _hyper_1_1_chunk (cost=0.27..20.20 rows=76000 width=12)
61
+ Custom Scan (DecompressChunk) on _hyper_1_1_chunk
62
62
Vectorized Filter: (value = '1'::double precision)
63
- -> Seq Scan on compress_hyper_2_4_chunk (cost=0.00..20.20 rows=76 width=76)
63
+ -> Seq Scan on compress_hyper_2_4_chunk
64
64
Filter: ((_ts_meta_v2_min_value <= '1'::double precision) AND (_ts_meta_v2_max_value >= '1'::double precision))
65
65
(4 rows)
66
66
67
67
-- Should survive renames.
68
68
alter table sparse rename column value to wert;
69
- explain select * from sparse where wert = 1;
69
+ explain (costs off) select * from sparse where wert = 1;
70
70
QUERY PLAN
71
71
-----------------------------------------------------------------------------------------------------------------------
72
- Custom Scan (DecompressChunk) on _hyper_1_1_chunk (cost=0.27..20.20 rows=76000 width=12)
72
+ Custom Scan (DecompressChunk) on _hyper_1_1_chunk
73
73
Vectorized Filter: (wert = '1'::double precision)
74
- -> Seq Scan on compress_hyper_2_4_chunk (cost=0.00..20.20 rows=76 width=76)
74
+ -> Seq Scan on compress_hyper_2_4_chunk
75
75
Filter: ((_ts_meta_v2_min_wert <= '1'::double precision) AND (_ts_meta_v2_max_wert >= '1'::double precision))
76
76
(4 rows)
77
77
78
78
alter table sparse rename column wert to value;
79
- explain select * from sparse where value = 1;
79
+ explain (costs off) select * from sparse where value = 1;
80
80
QUERY PLAN
81
81
-------------------------------------------------------------------------------------------------------------------------
82
- Custom Scan (DecompressChunk) on _hyper_1_1_chunk (cost=0.27..20.20 rows=76000 width=12)
82
+ Custom Scan (DecompressChunk) on _hyper_1_1_chunk
83
83
Vectorized Filter: (value = '1'::double precision)
84
- -> Seq Scan on compress_hyper_2_4_chunk (cost=0.00..20.20 rows=76 width=76)
84
+ -> Seq Scan on compress_hyper_2_4_chunk
85
85
Filter: ((_ts_meta_v2_min_value <= '1'::double precision) AND (_ts_meta_v2_max_value >= '1'::double precision))
86
86
(4 rows)
87
87
@@ -94,12 +94,12 @@ select count(compress_chunk(decompress_chunk(x))) from show_chunks('sparse') x;
94
94
1
95
95
(1 row)
96
96
97
- explain select * from sparse where value = 1;
98
- QUERY PLAN
99
- --------------------------------------------------------------------------------------------
100
- Custom Scan (DecompressChunk) on _hyper_1_1_chunk (cost=0.02..17.80 rows=780000 width=12)
97
+ explain (costs off) select * from sparse where value = 1;
98
+ QUERY PLAN
99
+ ------------------------------------------------------
100
+ Custom Scan (DecompressChunk) on _hyper_1_1_chunk
101
101
Vectorized Filter: (value = '1'::double precision)
102
- -> Seq Scan on compress_hyper_2_5_chunk (cost=0.00..17.80 rows=780 width=76)
102
+ -> Seq Scan on compress_hyper_2_5_chunk
103
103
(3 rows)
104
104
105
105
-- Not for other index types.
@@ -111,12 +111,12 @@ select count(compress_chunk(decompress_chunk(x))) from show_chunks('sparse') x;
111
111
1
112
112
(1 row)
113
113
114
- explain select * from sparse where value = 1;
115
- QUERY PLAN
116
- --------------------------------------------------------------------------------------------
117
- Custom Scan (DecompressChunk) on _hyper_1_1_chunk (cost=0.02..17.80 rows=780000 width=12)
114
+ explain (costs off) select * from sparse where value = 1;
115
+ QUERY PLAN
116
+ ------------------------------------------------------
117
+ Custom Scan (DecompressChunk) on _hyper_1_1_chunk
118
118
Vectorized Filter: (value = '1'::double precision)
119
- -> Seq Scan on compress_hyper_2_6_chunk (cost=0.00..17.80 rows=780 width=76)
119
+ -> Seq Scan on compress_hyper_2_6_chunk
120
120
(3 rows)
121
121
122
122
-- When the chunk is recompressed without index, no sparse index is created.
@@ -127,12 +127,12 @@ select count(compress_chunk(decompress_chunk(x))) from show_chunks('sparse') x;
127
127
1
128
128
(1 row)
129
129
130
- explain select * from sparse where value = 1;
131
- QUERY PLAN
132
- --------------------------------------------------------------------------------------------
133
- Custom Scan (DecompressChunk) on _hyper_1_1_chunk (cost=0.02..17.80 rows=780000 width=12)
130
+ explain (costs off) select * from sparse where value = 1;
131
+ QUERY PLAN
132
+ ------------------------------------------------------
133
+ Custom Scan (DecompressChunk) on _hyper_1_1_chunk
134
134
Vectorized Filter: (value = '1'::double precision)
135
- -> Seq Scan on compress_hyper_2_7_chunk (cost=0.00..17.80 rows=780 width=76)
135
+ -> Seq Scan on compress_hyper_2_7_chunk
136
136
(3 rows)
137
137
138
138
-- Long column names.
@@ -149,12 +149,12 @@ select count(compress_chunk(x)) from show_chunks('sparse') x;
149
149
1
150
150
(1 row)
151
151
152
- explain select * from sparse where Abcdef012345678_Bbcdef012345678_Cbcdef012345678_Dbcdef0 = 1;
152
+ explain (costs off) select * from sparse where Abcdef012345678_Bbcdef012345678_Cbcdef012345678_Dbcdef0 = 1;
153
153
QUERY PLAN
154
154
---------------------------------------------------------------------------------------------------------------------------------------------------------------
155
- Custom Scan (DecompressChunk) on _hyper_1_1_chunk (cost=3.48..10.45 rows=3000 width=264)
155
+ Custom Scan (DecompressChunk) on _hyper_1_1_chunk
156
156
Vectorized Filter: (abcdef012345678_bbcdef012345678_cbcdef012345678_dbcdef0 = 1)
157
- -> Seq Scan on compress_hyper_2_8_chunk (cost=0.00..10.45 rows=3 width=2092)
157
+ -> Seq Scan on compress_hyper_2_8_chunk
158
158
Filter: ((_ts_meta_v2_min_9218_abcdef012345678_bbcdef012345678_cbcdef0 <= 1) AND (_ts_meta_v2_max_9218_abcdef012345678_bbcdef012345678_cbcdef0 >= 1))
159
159
(4 rows)
160
160
0 commit comments