diff --git a/src/include/storage/page_compression_impl.h b/src/include/storage/page_compression_impl.h index a63177082ed874723c0332965e7dc047cc14fd34..a5f2bb5692a15589b76e48f636c0a959350cadf6 100644 --- a/src/include/storage/page_compression_impl.h +++ b/src/include/storage/page_compression_impl.h @@ -1407,8 +1407,9 @@ int TemplateCompressPage(const char* src, char* dst, int dst_size, RelFileCompre level = DEFAULT_ZSTD_COMPRESSION_LEVEL; } #ifndef FRONTEND - bool zstd_with_ctx = t_thrd.page_compression_cxt.zstd_cctx != NULL; - if (!zstd_with_ctx) { + bool zstd_advanced = t_thrd.page_compression_cxt.zstd_cctx != NULL && + level == DEFAULT_ZSTD_COMPRESSION_LEVEL; + if (!zstd_advanced) { compressed_size = ZSTD_compress(data, compressd_buffer_size, compress_src + sizeOfHeaderData, BLCKSZ - sizeOfHeaderData, level);