Re: Wrong results due to missing quals

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Wrong results due to missing quals
Date: 2023-05-24 21:28:30
Message-ID: 1329057.1684963710@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> ... Another idea is that maybe we need another
> RestrictInfo field that's directly a set of OJ relids that this clause
> can't be applied above. That'd reduce clause_is_computable_at to
> basically a bms_intersect test which would be nice speed-wise. The
> space consumption could be annoying, but I'm thinking that we might
> only have to populate the field in clone clauses, which would
> alleviate that issue.

I tried this and it seems to work all right: it fixes the example
you showed while not causing any new failures. (Doesn't address
the broken join-removal logic you showed in the other thread,
though.)

While at it, I also changed make_restrictinfo to treat has_clone
and is_clone as first-class citizens, to fix the dubious coding in
equivclass.c that I mentioned at [1].

regards, tom lane

[1] https://www.postgresql.org/message-id/395264.1684698283%40sss.pgh.pa.us

Attachment Content-Type Size
v1-track-incompatible-relids-for-clauses.patch text/x-diff 30.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-05-24 21:33:10 Re: SyncRepWaitForLSN waits for XLogFlush?
Previous Message Andres Freund 2023-05-24 21:28:03 Re: PostgreSQL 16 Beta 1 release announcement draft