Re: Checking join outer relation uniqueness to prevent unnecessary memoization

From: Jacob Jackson <jej(dot)jackson(dot)08(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Checking join outer relation uniqueness to prevent unnecessary memoization
Date: 2026-01-06 04:07:58
Message-ID: CAAiQw3z0K15z_Ojuoe6dh8NyG=GZR-t+UBvTWzoZ-6EDj-L-Fw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jan 4, 2026 at 6:09 PM David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
> For a fix, I suppose has_unique_index() could be expanded to find a
> unique index which mentions the particular Var and ensures that all
> other columns that exist in the index have EquivalenceClasses with an
> ec_has_const, but that would make that function much more expensive
> than it is today and it still wouldn't cover cases where there is
> another parameter in the Memoize lookup that matches to one of the
> other unique index's columns. That makes me think that the UniqueKey
> stuff might be the solution to these problems, as we'd easily be able
> to determine which unique properties hold true at any level of the
> join. That's a very complex patch, however.

Where can I find the past work on UniqueKey? Nothing turned up in the
git history.

Thanks!
Jacob

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Jackson 2026-01-06 04:24:52 Re: Proposal: Add a UNIQUE NOT ENFORCED constraint
Previous Message Tom Lane 2026-01-06 04:04:26 Re: Reject Foreign Tables from MIN/MAX indexscan Optimization?