Greenplum Database 6.32 introduces a new option, convert_quicklz_to_zstd, for the ALTER TABLE … SET WITH (REORGANIZE=true) command. This option allows append-optimized tables to convert data compressed with QuickLZ to Zstd.
The conversion supports both table-level and column-level compression.
This KB focuses on the behavior of this option when it is applied to a partitioned table, where child partitions may use different compression types, and the option is set on the root (parent) table.
A partitioned append-optimized table exists.
Child partitions use different compression settings:
Some partitions use quicklz
Some use other compression types (for example, zlib)
Some have no compression
The convert_quicklz_to_zstd=true option is applied at the root table level using ALTER TABLE … SET WITH (REORGANIZE=true).
When convert_quicklz_to_zstd=true is applied to the root partitioned table:
Only partitions using QuickLZ compression are converted to Zstd.
Partitions using other compression types (or no compression) remain unchanged.
CREATE TABLE sales (id int, date date, amt decimal)
WITH (appendoptimized=true, orientation=column)
DISTRIBUTED BY (id)
PARTITION BY RANGE (date) (
-- Partition 1: QuickLZ
PARTITION p1 START ('2023-01-01'::date) END ('2023-02-01'::date)
WITH (appendoptimized=true, orientation=column, compresstype=quicklz, compresslevel=1),
-- Partition 2: ZLIB
PARTITION p2 START ('2023-02-01'::date) END ('2023-03-01'::date)
WITH (appendoptimized=true, orientation=column, compresstype=zlib, compresslevel=5),
-- Partition 3: No Compression
PARTITION p3 START ('2023-03-01'::date) END ('2023-04-01'::date)
WITH (appendoptimized=true, orientation=column, compresstype=none)
);
ALTER TABLE sales
SET WITH (
REORGANIZE=true,
convert_quicklz_to_zstd=true
);
After the operation completes:
Partition p1 is converted from quicklz to zstd
Partition p2 (zlib) is unchanged
Partition p3 (none) is unchanged
Verification example:
for i in `seq 1 3`; do
echo -n "sales_1_prt_p${i}: ";
psql -c "\d+ sales_1_prt_p$i" | grep Options;
done
Output:
sales_1_prt_p1: Options: appendonly=true, orientation=column, compresstype=zstd, compresslevel=1
sales_1_prt_p2: Options: appendonly=true, orientation=column, compresstype=zlib, compresslevel=5
sales_1_prt_p3: Options: appendonly=true, orientation=column, compresstype=none
When convert_quicklz_to_zstd=true is executed on a partitioned table:
The conversion is selective.
Only partitions using QuickLZ are affected.
Other compression types and uncompressed partitions are not modified.
This behavior allows safe execution of the conversion on mixed-compression partitioned tables without impacting non-QuickLZ partitions.