Aggregate leads to superfluous projection from the scan

From: Zhihong Yu <zyu(at)yugabyte(dot)com>
To: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Aggregate leads to superfluous projection from the scan
Date: 2022-07-08 16:40:25
Message-ID: CALNJ-vTbeo5GN67tm_Wz89LrpnBXuh-KZQ8EeqNVpV0QL05WCw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
Here is the query which involves aggregate on a single column:

https://dbfiddle.uk/?rdbms=postgres_13&fiddle=44bfd8f6b6b5aad34d00d449c04c5a96

As you can see from `Output:`, there are many columns added which are not
needed by the query executor.

I wonder if someone has noticed this in the past.
If so, what was the discussion around this topic ?

Thanks

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2022-07-08 16:40:52 Re: Add last_vacuum_index_scans in pg_stat_all_tables
Previous Message Bharath Rupireddy 2022-07-08 16:33:49 Re: pg_walcleaner - new tool to detect, archive and delete the unneeded wal files (was Re: pg_archivecleanup - add the ability to detect, archive and delete the unneeded wal files on the primary)