## PostgreSQL 18.3 CREATE TABLE t(c1 int,c2 int); postgres=# EXPLAIN(VERBOSE) SELECT c1, c2 FROM t ORDER BY c1,c2; QUERY PLAN ------------------------------------------------------------------ Sort (cost=158.51..164.16 rows=2260 width=8) Output: c1, c2 Sort Key: t.c1, t.c2 -> Seq Scan on public.t (cost=0.00..32.60 rows=2260 width=8) Output: c1, c2 Query Identifier: -4675081474881745094 (6 rows) postgres=# EXPLAIN(VERBOSE) SELECT c2, c1 FROM t ORDER BY c1,c2; QUERY PLAN ------------------------------------------------------------------ Sort (cost=158.51..164.16 rows=2260 width=8) Output: c2, c1 Sort Key: t.c1, t.c2 -> Seq Scan on public.t (cost=0.00..32.60 rows=2260 width=8) Output: c2, c1 Query Identifier: -3269814016130981549 (6 rows) postgres=# EXPLAIN(VERBOSE) SELECT c1 FROM t ORDER BY c1,c2; QUERY PLAN ------------------------------------------------------------------ Sort (cost=158.51..164.16 rows=2260 width=8) Output: c1, c2 Sort Key: t.c1, t.c2 -> Seq Scan on public.t (cost=0.00..32.60 rows=2260 width=8) Output: c1, c2 Query Identifier: -4675081474881745094 (6 rows) postgres=# EXPLAIN(VERBOSE) SELECT c2 FROM t ORDER BY c1,c2; QUERY PLAN ------------------------------------------------------------------ Sort (cost=158.51..164.16 rows=2260 width=8) Output: c2, c1 Sort Key: t.c1, t.c2 -> Seq Scan on public.t (cost=0.00..32.60 rows=2260 width=8) Output: c2, c1 Query Identifier: -3269814016130981549 (6 rows) ## PostreSQL 19dev(d841ca2d149666b8) with Patch CREATE TABLE t(c1 int,c2 int); postgres=# EXPLAIN(VERBOSE) SELECT c1, c2 FROM t ORDER BY c1,c2; QUERY PLAN ------------------------------------------------------------------ Sort (cost=158.51..164.16 rows=2260 width=8) Output: c1, c2 Sort Key: t.c1, t.c2 -> Seq Scan on public.t (cost=0.00..32.60 rows=2260 width=8) Output: c1, c2 Query Identifier: 3650220897747797500 (6 rows) postgres=# EXPLAIN(VERBOSE) SELECT c2, c1 FROM t ORDER BY c1,c2; QUERY PLAN ------------------------------------------------------------------ Sort (cost=158.51..164.16 rows=2260 width=8) Output: c2, c1 Sort Key: t.c1, t.c2 -> Seq Scan on public.t (cost=0.00..32.60 rows=2260 width=8) Output: c2, c1 Query Identifier: -3038222286574995023 (6 rows) postgres=# EXPLAIN(VERBOSE) SELECT c1 FROM t ORDER BY c1,c2; QUERY PLAN ------------------------------------------------------------------ Sort (cost=158.51..164.16 rows=2260 width=8) Output: c1, c2 Sort Key: t.c1, t.c2 -> Seq Scan on public.t (cost=0.00..32.60 rows=2260 width=8) Output: c1, c2 Query Identifier: -8371868852328991336 (6 rows) postgres=# EXPLAIN(VERBOSE) SELECT c2 FROM t ORDER BY c1,c2; QUERY PLAN ------------------------------------------------------------------ Sort (cost=158.51..164.16 rows=2260 width=8) Output: c2, c1 Sort Key: t.c1, t.c2 -> Seq Scan on public.t (cost=0.00..32.60 rows=2260 width=8) Output: c2, c1 Query Identifier: -8689818593596346321 (6 rows)