Skip to content

Commit 0246921

Browse files
committed
Enable bool compression
This change sets the default for the GUC value: `timescaledb.enable_bool_compression=true`
1 parent c3bb352 commit 0246921

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

.unreleased/pr_8014

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Implements: #8014 enable bool compression by default by setting `timescaledb.enable_bool_compression=true`

src/guc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ TSDLLEXPORT bool ts_guc_default_hypercore_use_access_method = false;
154154
bool ts_guc_enable_chunk_skipping = false;
155155
TSDLLEXPORT bool ts_guc_enable_segmentwise_recompression = true;
156156
TSDLLEXPORT bool ts_guc_enable_exclusive_locking_recompression = false;
157-
TSDLLEXPORT bool ts_guc_enable_bool_compression = false;
157+
TSDLLEXPORT bool ts_guc_enable_bool_compression = true;
158158
TSDLLEXPORT int ts_guc_compression_batch_size_limit = 1000;
159159

160160
/* Only settable in debug mode for testing */
@@ -795,10 +795,10 @@ _guc_init(void)
795795
NULL);
796796

797797
DefineCustomBoolVariable(MAKE_EXTOPTION("enable_bool_compression"),
798-
"Enable experimental bool compression functionality",
798+
"Enable bool compression functionality",
799799
"Enable bool compression",
800800
&ts_guc_enable_bool_compression,
801-
false,
801+
true,
802802
PGC_USERSET,
803803
0,
804804
NULL,

tsl/src/nodes/decompress_chunk/compressed_batch.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,18 +221,25 @@ decompress_column(DecompressContext *dcontext, DecompressBatchState *batch_state
221221
DecompressAllFunction decompress_all =
222222
tsl_get_decompress_all_function(header->compression_algorithm,
223223
column_description->typid);
224-
Assert(decompress_all != NULL);
225224

226-
MemoryContext context_before_decompression =
227-
MemoryContextSwitchTo(dcontext->bulk_decompression_context);
225+
/*
226+
* The decompress_all function is not defined for ARRAY and DICTIONARY
227+
* compression types, except for TEXTOID, so it is valid to have
228+
* a NULL pointer here, and it must be handled.
229+
*/
230+
if (decompress_all != NULL)
231+
{
232+
MemoryContext context_before_decompression =
233+
MemoryContextSwitchTo(dcontext->bulk_decompression_context);
228234

229-
arrow = decompress_all(PointerGetDatum(header),
230-
column_description->typid,
231-
batch_state->per_batch_context);
235+
arrow = decompress_all(PointerGetDatum(header),
236+
column_description->typid,
237+
batch_state->per_batch_context);
232238

233-
MemoryContextSwitchTo(context_before_decompression);
239+
MemoryContextSwitchTo(context_before_decompression);
234240

235-
MemoryContextReset(dcontext->bulk_decompression_context);
241+
MemoryContextReset(dcontext->bulk_decompression_context);
242+
}
236243
}
237244

238245
if (arrow == NULL)

0 commit comments

Comments
 (0)