Re: ERROR: PlaceHolderVar found where not expected

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: ERROR: PlaceHolderVar found where not expected
Date: 2023-03-14 06:08:23
Message-ID: CAMbWs48cMBufePPYkjXF-JJBKPdVupG5vpa2tU3y4TxFzoP+Qw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Mar 14, 2023 at 11:39 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Actually, on closer look: why don't we just nuke that pull_var_clause
> call entirely, along with the following loop inspecting its result?
>
> The subsequent loop that looks for a matching StatisticExtInfo
> expression will do just fine at rejecting any expression that
> contains Vars of the wrong relation. Maybe there is some performance
> argument why the pull_var_clause precheck is worth the trouble,
> but I'm inclined to bet that it's actually a net loss.

Yes agreed. The pull_var_clause precheck is not necessary considering
we would match the 'clause_expr' to StatisticExtInfo expressions with
equal(). +1 to remove it.

Thanks
Richard

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Guo 2023-03-14 10:32:54 Re: Clause accidentally pushed down ( Possible bug in Making Vars outer-join aware)
Previous Message jitesh tiwari 2023-03-14 06:07:33 Re: Invalid memory allocation error with pg_recvlogical or with libPQ logical connection