diff --git a/tsl/src/compression/compression.c b/tsl/src/compression/compression.c index b3f3e53a40e..f810e41db97 100644 --- a/tsl/src/compression/compression.c +++ b/tsl/src/compression/compression.c @@ -1471,6 +1471,7 @@ build_decompressor(Relation in_rel, Relation out_rel) void row_decompressor_reset(RowDecompressor *decompressor) { + MemoryContextReset(decompressor->per_compressed_row_ctx); decompressor->unprocessed_tuples = 0; decompressor->batches_decompressed = 0; decompressor->tuples_decompressed = 0; @@ -1805,8 +1806,6 @@ row_decompressor_decompress_row_to_table(RowDecompressor *decompressor) } MemoryContextSwitchTo(old_ctx); - MemoryContextReset(decompressor->per_compressed_row_ctx); - row_decompressor_reset(decompressor); return n_batch_rows; @@ -1826,8 +1825,6 @@ row_decompressor_decompress_row_to_tuplesort(RowDecompressor *decompressor, } MemoryContextSwitchTo(old_ctx); - MemoryContextReset(decompressor->per_compressed_row_ctx); - row_decompressor_reset(decompressor); }