Hi,

On 2025-12-18 20:40:31 +0100, Maxime Schoemans wrote:
> > On 10 Dec 2025, at 00:08, Andres Freund <[email protected]> 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?

That's part of it, but not all of it: The other aspect is that if you do a
bunch of heap_getattr()s inside HeapKeyTest() and then project that column in
nodeSeqscan.c, you'll do the work to deform twice.


> > 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.

As hinted at in [1] I suspect that you're just not going to see big enough
wins without the above optimization. A decent portion of the win from using
HeapKeyTest is to only selectively deform.

Greetings,

Andres Freund

[1] 
https://postgr.es/m/CAAh00EQUwG5khqJO7nSV0nsqsG1OP%3DkA6ACfxV3rnNSVd4b6TQ%40mail.gmail.com


Reply via email to