Re: interval_ops shall stop using btequalimage (deduplication) - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: interval_ops shall stop using btequalimage (deduplication)
Date
Msg-id CAH2-WzkJYoBDx8Yc3Nhmhc9H9pN0Uz9_tmXn-pr12CSU7JgAsA@mail.gmail.com
Whole thread Raw
In response to Re: interval_ops shall stop using btequalimage (deduplication)  (Donghang Lin <donghanglin@gmail.com>)
List pgsql-hackers
On Mon, Oct 16, 2023 at 11:21 PM Donghang Lin <donghanglin@gmail.com> wrote:
> It seems to me that as long as a data type has a deterministic sort but not necessarily be equalimage,
> it should be able to support deduplication.  e.g for interval type, we add a byte wise tie breaker
> after '24h' and '1day' are compared equally. In the btree, '24h' and '1day' are still adjacent,
> '1day' is always sorted before '24h' in a btree page, can we do dedup for each value
> without problem?
> The assertion will still be triggered as it's testing btequalimage, but I'll defer it for now.
> Wanted to know if the above idea sounds sane first...

 It's hard to give any one reason why this won't work. I'm sure that
with enough effort some scheme like this could work. It's just that
there are significant practical problems that at least make it seem
unappealing as a project. This has been discussed before:


https://www.postgresql.org/message-id/flat/CAH2-WzkZkSC7G%2Bv1WwXGo0emh8E-rByw%3DxSpBUoavk7PTjwF2Q%40mail.gmail.com#4e98cba0d76c8c8c0bf67ae0d4652903

--
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: PostgreSQL domains and NOT NULL constraint
Next
From: "David E. Wheeler"
Date:
Subject: Re: Patch: Improve Boolean Predicate JSON Path Docs