From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: yaojia_0809@163.com
Subject: BUG #19372: Scan operator maybe output unnecessary columns to the upper-layer operators
Date: Wed, 07 Jan 2026 08:11:02 +0000
Message-ID: <19372-4692c7e7044c10ef@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 19372
Logged by: yao jia
Email address: yaojia_0809@163.com
PostgreSQL version: 18.0
Operating system: linux centos
Description:
The scan operator maybe output unnecessary columns to the upper-layer
operators. This seems like redundant work because the upper-layer operators
don't need these column data at all. This undoubtedly increases execution
overhead.
Is this behavior intentionally designed this way, or is it an unintended
side effect? Should the unnecessary column output be eliminated?
Here is a specific example:columns [jname, c, d, e] are useless for group
and final output, but they are in seqscan's output
postgres=# create table hash_hash_jade22 (hjid int,rjid int,jname varchar, c
varchar, d varchar, e varchar);
CREATE TABLE
postgres=# explain verbose select min(hjid) from hash_hash_jade22 group by
rjid;
QUERY PLAN
--------------------------------------------------------------------------------
HashAggregate (cost=17.35..19.35 rows=200 width=8)
Output: min(hjid), rjid
Group Key: hash_hash_jade22.rjid
-> Seq Scan on public.hash_hash_jade22 (cost=0.00..14.90 rows=490
width=8)
Output: hjid, rjid, jname, c, d, e
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, yaojia_0809@163.com
Subject: Re: BUG #19372: Scan operator maybe output unnecessary columns to the upper-layer operators
In-Reply-To: <19372-4692c7e7044c10ef@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox