Re: track needed attributes in plan nodes for executor use

From: Andrei Lepikhov <lepihov(at)gmail(dot)com>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: track needed attributes in plan nodes for executor use
Date: 2025-07-14 08:04:01
Message-ID: f6bebff7-e942-4d78-a8b5-ed6f41bada89@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 14/7/2025 06:52, Amit Langote wrote:
> On Fri, Jul 11, 2025 at 11:09 PM Andrei Lepikhov <lepihov(at)gmail(dot)com> wrote:
> To support that efficiently, the slot can store a new tts_min_valid
> field to indicate the lowest attno that needs deforming.
> Alternatively, we could use a per-attribute flag array (with
> TupleDesc->natts elements), though that adds some memory and
> complexity. The first option seems simpler and should be sufficient in
> most cases.
I'm not sure. Typically, people don't optimise the order of columns, and
it seems to me that necessary columns can be found both at the beginning
of the table (like the primary key) and at the end. I believe it's best
to skip any unused columns. However, I haven't seen your patch yet to
talk about the effect.

> I wasn’t quite sure what you meant about the CustomScan API, could you
> elaborate?
I was thinking that custom logic might require some columns that are not
detected in the target list or qualifications. Therefore, there should
be a method to provide the core with a list of the necessary columns.

--
regards, Andrei Lepikhov

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Japin Li 2025-07-14 08:08:06 Requested WAL segment xxx has already been removed
Previous Message Dean Rasheed 2025-07-14 07:21:19 Re: [PATCH] Generate random dates/times in a specified range