Re: Tracking per-RelOptInfo uniqueness during planning

From: Chengpeng Yan <chengpeng_yan(at)outlook(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Ilia Evdokimov <ilidock95(at)gmail(dot)com>, Antonin Houska <ah(at)cybertec(dot)at>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andy Fan <zhihuifan1213(at)163(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>
Subject: Re: Tracking per-RelOptInfo uniqueness during planning
Date: 2026-12-06 12:52:34
Message-ID: C0458262-E77C-46CB-AA2D-06E1274C0DBE@outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Richard,

> On Dec 6, 2026, at 09:07, Richard Guo <guofenglinux(at)gmail(dot)com> wrote:
>
> For anyone who wants to review the design, 0001 is the place to look.
> It introduces UniqueKeys, which are kept for base relations only, and
> works out whether a join relation is distinct from the UniqueKeys of
> its base relations.
>
> The logic and code in 0001-0003 are simple and straightforward, so I'm
> quite confident in them and may push them in the near future, unless
> anyone objects.

I had a look at 0001-0003 and didn't spot any correctness issues.

One small question: should the two new PlannerInfo fields,
uniquekeys_built and no_uniquekey_relids, also be reset at the
"restart:" label in query_planner()?

--
Best regards,
Chengpeng Yan

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Zhijie Hou 2026-12-06 12:47:21 Re: Incremental backup inconsistency after vacuum truncation + COPY regrowth