Re: interval_ops shall stop using btequalimage (deduplication)

Peter Geoghegan <pg@bowt.ie>

From: Peter Geoghegan <pg@bowt.ie>
To: Donghang Lin <donghanglin@gmail.com>
Cc: Noah Misch <noah@leadboat.com>, pgsql-hackers@postgresql.org
Date: 2023-10-23T22:53:24Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Dissociate btequalimage() from interval_ops, ending its deduplication.

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