Re: interval_ops shall stop using btequalimage (deduplication)

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Donghang Lin <donghanglin(at)gmail(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: interval_ops shall stop using btequalimage (deduplication)
Date: 2023-10-23 22:53:24
Message-ID: CAH2-WzkJYoBDx8Yc3Nhmhc9H9pN0Uz9_tmXn-pr12CSU7JgAsA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 16, 2023 at 11:21 PM Donghang Lin <donghanglin(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2023-10-23 22:58:18 Re: Patch: Improve Boolean Predicate JSON Path Docs
Previous Message Tom Lane 2023-10-23 22:08:08 Re: PostgreSQL domains and NOT NULL constraint