Re: pgsql: Invalidate RI fast-path metadata on operator family changes

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Alexander Lakhin <exclusion(at)gmail(dot)com>
Cc: Amit Langote <amitlangote09(at)gmail(dot)com>, Amit Langote <amitlan(at)postgresql(dot)org>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Invalidate RI fast-path metadata on operator family changes
Date: 2026-09-20 00:43:31
Message-ID: CAMbWs49M_=7ya47-1McJSyW4Bf4haT5EAHq8263znRxOWZ=t5Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Sun, Sep 20, 2026 at 3:00 AM Alexander Lakhin <exclusion(at)gmail(dot)com> wrote:
> I think the window failures are caused by these additions:
> +create operator family fam using btree;
> +create operator class int_ops for type integer using btree family fam as
> + operator 1 <(integer,integer), operator 2 <=(integer,integer),
> + operator 3 =(integer,integer), operator 4 >=(integer,integer),
> + operator 5 >(integer,integer), function 1 btint4cmp(integer,integer);

FWIW, this seems to also cause the equivclass failure on widowbird [1].

It seems to me what happens is that the new family adds operator 3
=(bigint,bigint), i.e. int8eq. So in

select * from ec0 a, ec1 b
where a.ff = b.ff and a.ff = 43::bigint::int8alias1;

get_mergejoin_opfamilies() gives a.ff = b.ff {integer_ops, fam} while
a.ff = 43::int8alias1 stays {integer_ops}, and process_equivalence()
requires those lists to be equal(). The two clauses land in separate
ECs, the constant never propagates to b.ff, and we get

- Index Cond: (ff = '43'::int8alias1)
+ Index Cond: (ff = a.ff)

[1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=widowbird&dt=2026-09-19%2019%3A50%3A41

- Richard

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2026-09-20 03:20:08 Re: pgsql: Invalidate RI fast-path metadata on operator family changes
Previous Message Alexander Lakhin 2026-09-19 18:00:00 Re: pgsql: Invalidate RI fast-path metadata on operator family changes