Re: "type with xxxx does not exist" when doing ExecMemoize()

From: Andrei Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>
To: Tender Wang <tndrwang(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: "type with xxxx does not exist" when doing ExecMemoize()
Date: 2024-02-26 09:30:50
Message-ID: 00f65092-0b44-4b3b-9b66-6ebee90def3a@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 26/2/2024 15:14, Tender Wang wrote:
>
>
> Andrei Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru
> <mailto:a(dot)lepikhov(at)postgrespro(dot)ru>> 于2024年2月26日周一 10:57写道:
>
> On 25/2/2024 20:32, Tender Wang wrote:
> > I think in prepare_probe_slot(), should called datumCopy as the
> attached
> > patch does.
> >
> > Any thoughts? Thanks.
> Thanks for the report.
> I think it is better to invent a Runtime Memory Context; likewise,
> it is
> already designed in IndexScan and derivatives. Here, you just allocate
> the value in some upper memory context.
>
> Also, I'm curious why such a trivial error hasn't been found for a
> long time
>
>   I analyze this issue again. I found that the forms of qual in
> Memoize.sql(regress) are all like this:
>
>   table1.c0 OP table2.c0
> If table2.c0 is the param value, the probeslot->tts_values[i] just store
> the pointer.  The memorycontext of this pointer is
> ExecutorContext not ExprContext, Reset ExprContext doesn't change the
> data of probeslot->tts_values[i].
> So such a trivial error hasn't been found before.
I'm not happy with using table context for the probeslot values. As I
see, in the case of a new entry, the cache_lookup copies data from this
slot. If a match is detected, the allocated probeslot memory piece will
not be freed up to hash table reset. Taking this into account, should we
invent some new runtime context?

--
regards,
Andrei Lepikhov
Postgres Professional

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Guo 2024-02-26 11:34:33 Re: "type with xxxx does not exist" when doing ExecMemoize()
Previous Message Laurenz Albe 2024-02-26 09:19:09 Re: systemd[1]: postgresql-16.service: Killing process 25992 (postgres) with signal SIGKILL.

Browse pgsql-hackers by date

  From Date Subject
Next Message Josef Šimánek 2024-02-26 09:31:53 Re: [PATCH] Add --syntax to postgres for SQL syntax checking
Previous Message Bertrand Drouvot 2024-02-26 09:14:07 Re: Documentation: warn about two_phase when altering a subscription