Re: UniqueKey on Partitioned table. - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: UniqueKey on Partitioned table.
Date
Msg-id CAExHW5tN=y8+uY=7-rXLSSM-ebmRVe6nRUBSBVshpULpBa5zvA@mail.gmail.com
Whole thread Raw
In response to Re: UniqueKey on Partitioned table.  (Andy Fan <zhihui.fan1213@gmail.com>)
Responses Re: UniqueKey on Partitioned table.  (Andy Fan <zhihui.fan1213@gmail.com>)
List pgsql-hackers
> b).  How to present the element
> in UniqueKey.  Prue EquivalenceClasses or Mix of Expr and EquivalenceClass as
> we just talked about.
I think the reason we add ECs for sort expressions is to use
transitive relationship. The EC may start with a single member but
later in the planning that member might find partners which are all
equivalent. Result ordered by one is also ordered by the other. The
same logic applies to UniqueKey as well, isn't it. In a result if a
set of columns makes a row unique, the set of columns represented by
the other EC member should be unique. Though a key will start as a
singleton it might EC partners later and thus thus unique key will
transition to all the members. With that logic UniqueKey should use
just ECs instead of bare expressions.

-- 
Best Wishes,
Ashutosh Bapat



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?
Next
From: Masahiko Sawada
Date:
Subject: Re: Flaky vacuum truncate test in reloptions.sql