From be3daf9735455d31b5fe955381d76e81652d8516 Mon Sep 17 00:00:00 2001 From: Xiao__Ma Date: Wed, 21 Jul 2021 15:38:31 +0800 Subject: [PATCH] parse --- src/common/backend/parser/parse_utilcmd.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/common/backend/parser/parse_utilcmd.cpp b/src/common/backend/parser/parse_utilcmd.cpp index c5739420a..7caeb8497 100644 --- a/src/common/backend/parser/parse_utilcmd.cpp +++ b/src/common/backend/parser/parse_utilcmd.cpp @@ -1406,6 +1406,15 @@ static void transformTableLikeClause( def->storage = 0; /* copy compression mode from source table */ def->cmprs_mode = attribute->attcmprmode; + /* + * When analyzing a column-oriented table with default_statistics_target < 0, we will create a row-oriented + * temp table. In this case, ignore the compression flag. + */ + if (u_sess->analyze_cxt.is_under_analyze) { + if (def->cmprs_mode != ATT_CMPR_UNDEFINED) { + def->cmprs_mode = ATT_CMPR_NOCOMPRESS; + } + } def->raw_default = NULL; def->cooked_default = NULL; def->collClause = NULL;