Re: Qual push down to table AM - Mailing list pgsql-hackers

From Maxime Schoemans
Subject Re: Qual push down to table AM
Date
Msg-id 78A164FE-0AD2-4F9A-AA07-81887D4CB6A4@enterprisedb.com
Whole thread Raw
In response to Re: Qual push down to table AM  (Andres Freund <andres@anarazel.de>)
Responses Re: Qual push down to table AM
List pgsql-hackers
Hi,

> On 10 Dec 2025, at 00:08, Andres Freund <andres@anarazel.de> wrote:
> I don't really see this being viable without first tackling two nontrivial
> projects:
>
> 2) Perform ScanKey evaluation in slot form, to be able to cache the deforming
>   and to make deforming of multiple columns sufficiently efficient.

Am I right in understanding that you think that the repeated calls to
heap_getattr in HeapKeyTest is not ideal if we have NULL or varlena
columns? I have written a small patch (see attached) that stores the heap
tuple in a TupleTableSlot first and then calls slot_getattr instead, which
should benefit from caching. Is that the type of solution you were thinking of?

It is definitely not a complete patch (needs comments and a description),
and it is not merged into the patch set of Julien yet, but I just wanted to
check that this was what you were proposing and that I was not
misunderstanding something.

> 1) Make slot deforming for expressions & projections selective, i.e. don't
>   deform all the leading columns, but only ones that will eventually be
>   needed


Concerning 1), I’m also not certain I understand why this is a prerequisite for
the pushdown work. It could certainly be beneficial, but it seems to be
complementary. In any case, I’d be interested to look at your POC patch
on the subject, Amit.

Best,

Maxime Schoemans

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Recovering from detoast-related catcache invalidations
Next
From: Masahiko Sawada
Date:
Subject: Re: Assertion failure in SnapBuildInitialSnapshot()