diff --git a/gpcontrib/zstd/expected/compression_zstd.out b/gpcontrib/zstd/expected/compression_zstd.out index 912cf950a02c..d0639bb51411 100644 --- a/gpcontrib/zstd/expected/compression_zstd.out +++ b/gpcontrib/zstd/expected/compression_zstd.out @@ -5,23 +5,23 @@ HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sur INSERT INTO zstdtest SELECT g, 'foo' || g FROM generate_series(1, 100000) g; INSERT INTO zstdtest SELECT g, 'bar' || g FROM generate_series(1, 100000) g; -- Check contents, at the beginning of the table and at the end. -SELECT * FROM zstdtest ORDER BY id LIMIT 5; +SELECT * FROM zstdtest ORDER BY (id, t) LIMIT 5; id | t ----+------ 1 | bar1 1 | foo1 - 2 | foo2 2 | bar2 + 2 | foo2 3 | bar3 (5 rows) -SELECT * FROM zstdtest ORDER BY id DESC LIMIT 5; +SELECT * FROM zstdtest ORDER BY (id, t) DESC LIMIT 5; id | t --------+----------- - 100000 | bar100000 100000 | foo100000 - 99999 | bar99999 + 100000 | bar100000 99999 | foo99999 + 99999 | bar99999 99998 | foo99998 (5 rows) @@ -37,46 +37,46 @@ NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'id' a HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. INSERT INTO zstdtest_1 SELECT g, 'foo' || g FROM generate_series(1, 10000) g; INSERT INTO zstdtest_1 SELECT g, 'bar' || g FROM generate_series(1, 10000) g; -SELECT * FROM zstdtest_1 ORDER BY id LIMIT 5; +SELECT * FROM zstdtest_1 ORDER BY (id, t) LIMIT 5; id | t ----+------ 1 | bar1 1 | foo1 - 2 | foo2 2 | bar2 + 2 | foo2 3 | bar3 (5 rows) -SELECT * FROM zstdtest_1 ORDER BY id DESC LIMIT 5; +SELECT * FROM zstdtest_1 ORDER BY (id, t) DESC LIMIT 5; id | t -------+---------- 10000 | foo10000 10000 | bar10000 - 9999 | bar9999 9999 | foo9999 - 9998 | bar9998 + 9999 | bar9999 + 9998 | foo9998 (5 rows) INSERT INTO zstdtest_19 SELECT g, 'foo' || g FROM generate_series(1, 10000) g; INSERT INTO zstdtest_19 SELECT g, 'bar' || g FROM generate_series(1, 10000) g; -SELECT * FROM zstdtest_19 ORDER BY id LIMIT 5; +SELECT * FROM zstdtest_19 ORDER BY (id, t) LIMIT 5; id | t ----+------ 1 | bar1 1 | foo1 - 2 | foo2 2 | bar2 + 2 | foo2 3 | bar3 (5 rows) -SELECT * FROM zstdtest_19 ORDER BY id DESC LIMIT 5; +SELECT * FROM zstdtest_19 ORDER BY (id, t) DESC LIMIT 5; id | t -------+---------- 10000 | foo10000 10000 | bar10000 - 9999 | bar9999 9999 | foo9999 - 9998 | bar9998 + 9999 | bar9999 + 9998 | foo9998 (5 rows) -- Test the bounds of compresslevel. None of these are allowed. diff --git a/gpcontrib/zstd/sql/compression_zstd.sql b/gpcontrib/zstd/sql/compression_zstd.sql index 744067f45125..a50414fa2108 100644 --- a/gpcontrib/zstd/sql/compression_zstd.sql +++ b/gpcontrib/zstd/sql/compression_zstd.sql @@ -6,8 +6,8 @@ INSERT INTO zstdtest SELECT g, 'foo' || g FROM generate_series(1, 100000) g; INSERT INTO zstdtest SELECT g, 'bar' || g FROM generate_series(1, 100000) g; -- Check contents, at the beginning of the table and at the end. -SELECT * FROM zstdtest ORDER BY id LIMIT 5; -SELECT * FROM zstdtest ORDER BY id DESC LIMIT 5; +SELECT * FROM zstdtest ORDER BY (id, t) LIMIT 5; +SELECT * FROM zstdtest ORDER BY (id, t) DESC LIMIT 5; -- Test different compression levels: @@ -17,13 +17,13 @@ CREATE TABLE zstdtest_19 (id int4, t text) WITH (appendonly=true, compresstype=z INSERT INTO zstdtest_1 SELECT g, 'foo' || g FROM generate_series(1, 10000) g; INSERT INTO zstdtest_1 SELECT g, 'bar' || g FROM generate_series(1, 10000) g; -SELECT * FROM zstdtest_1 ORDER BY id LIMIT 5; -SELECT * FROM zstdtest_1 ORDER BY id DESC LIMIT 5; +SELECT * FROM zstdtest_1 ORDER BY (id, t) LIMIT 5; +SELECT * FROM zstdtest_1 ORDER BY (id, t) DESC LIMIT 5; INSERT INTO zstdtest_19 SELECT g, 'foo' || g FROM generate_series(1, 10000) g; INSERT INTO zstdtest_19 SELECT g, 'bar' || g FROM generate_series(1, 10000) g; -SELECT * FROM zstdtest_19 ORDER BY id LIMIT 5; -SELECT * FROM zstdtest_19 ORDER BY id DESC LIMIT 5; +SELECT * FROM zstdtest_19 ORDER BY (id, t) LIMIT 5; +SELECT * FROM zstdtest_19 ORDER BY (id, t) DESC LIMIT 5; -- Test the bounds of compresslevel. None of these are allowed.