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>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: "type with xxxx does not exist" when doing ExecMemoize()
Date: 2024-02-26 05:38:09
Message-ID: 32a955a1-1cbb-442e-b903-bcb5982a1e58@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 26/2/2024 09:52, Andrei Lepikhov wrote:
> 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
Hmmm. I see the problem (test.sql in attachment for reproduction and
results). We only detect it by the number of Hits:
Cache Key: t1.x, (t1.t)::numeric
Cache Mode: logical
Hits: 0 Misses: 30 Evictions: 0 Overflows: 0 Memory Usage: 8kB

We see no hits in logical mode and 100 hits in binary mode. We see 15
hits for both logical and binary mode if parameters are integer numbers
- no problems with resetting expression context.

Your patch resolves the issue for logical mode - I see 15 hits for
integer and complex keys. But I still see 100 hits in binary mode. Maybe
we still have a problem?

What's more, why the Memoize node doesn't see the problem at all?

--
regards,
Andrei Lepikhov
Postgres Professional

Attachment Content-Type Size
test.sql application/sql 7.5 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Lakhin 2024-02-26 06:00:01 Re: BUG #18363: Assert !ReindexIsProcessingIndex falsified with expression index over select from table
Previous Message Andrei Lepikhov 2024-02-26 02:52:59 Re: "type with xxxx does not exist" when doing ExecMemoize()

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2024-02-26 06:16:11 Re: SQL Property Graph Queries (SQL/PGQ)
Previous Message Michael Paquier 2024-02-26 05:28:08 Re: Speeding up COPY TO for uuids and arrays