Re: Optimize common expressions in projection evaluation

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Peifeng Qiu <pgsql(at)qiupf(dot)dev>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Optimize common expressions in projection evaluation
Date: 2022-12-02 13:29:42
Message-ID: CAKFQuwYQ96h3hmc9sNJixKL13spqGX5V-nGZUArmuTM_qaWyNQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Dec 2, 2022 at 12:52 AM Peifeng Qiu <pgsql(at)qiupf(dot)dev> wrote:

> Hi hackers.
>
> When a star(*) expands into multiple fields, our current
> implementation is to generate multiple copies of the expression
> and do FieldSelects. This is very inefficient because the same
> expression get evaluated multiple times but actually we only need
> to do it once.

And so we implemented the SQL Standard LATERAL and all was well.

Given both how long we didn't have lateral and didn't do something like
this, and how long lateral has been around and this hasn't really come up,
the need for this code seems not that great. But as to the code itself I'm
unable to properly judge.

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2022-12-02 13:35:58 Re: Optimizing Node Files Support
Previous Message Robert Haas 2022-12-02 13:27:58 Re: Error-safe user functions