pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Noah Misch <noah@leadboat.com>
To: Donghang Lin <donghanglin@gmail.com>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: pgsql-hackers@postgresql.org
Subject: Re: interval_ops shall stop using btequalimage (deduplication)
Date: Mon, 23 Oct 2023 06:07:10 -0700
Message-ID: <20231023130710.00.nmisch@google.com> (raw )
In-Reply-To: <CAA=D8a0J2N-waEPmbqT7xkySNZUbFnX5O80mnLxTxALBY2VcfQ@mail.gmail.com >
References: <20231011013317.22.nmisch@google.com >
<CAH2-Wzm_OFH4Aip3uinAJ-AoBgX0wGjB9XBhrhkTnjCoZ_i8NA@mail.gmail.com >
<20231011032908.35@rfd.leadboat.com >
<CAH2-WzmDbyMj_7Ev5vPmt7UaKjuRg6m79sRguTjehyZtuBPMgw@mail.gmail.com >
<CAH2-WzmCppEF8UFUVLbL3SXLD3UwB-5sDV2YC99soN6O0ScWpg@mail.gmail.com >
<20231011183835.32@rfd.leadboat.com >
<CAH2-WzmcUFVB91ARCU5Dg8TPEifxYG_0iaOwsiDiu5Y01b8_cQ@mail.gmail.com >
<20231012231009.bf.nmisch@google.com >
<CAH2-Wzm2ydcgC0x-=tOpJc5jYbaw63ntG5Z2Ro1fnPEphdzDeg@mail.gmail.com >
<CAA=D8a0J2N-waEPmbqT7xkySNZUbFnX5O80mnLxTxALBY2VcfQ@mail.gmail.com >
On Mon, Oct 16, 2023 at 11:21:20PM -0700, Donghang Lin wrote:
> > I've also caught btree posting lists where one TID refers to a '1d' heap
> > tuple, while another TID refers to a '24h' heap tuple. amcheck complains.
> Index-only scans can return the '1d' bits where the actual tuple had the
> '24h'
> bits.
>
> Have a build without the patch. I can't reproduce amcheck complaints in
> release mode
> where all these statements succeed.
The queries I shared don't create the problematic structure, just an assertion
failure.
> > * Generic "equalimage" support function.
> > *
> > * B-Tree operator classes whose equality function could safely be
> replaced by
> > * datum_image_eq() in all cases can use this as their "equalimage" support
> > * function.
> 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?
Yes. I'm not aware of correctness obstacles arising if one did that.
view thread (12+ messages) latest in thread
Message-ID: <20231023130710.00.nmisch@google.com>
Permalink: ../20231023130710.00.nmisch@google.com/
Also on: postgresql.org/message-id/20231023130710.00.nmisch@google.com
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: noah@leadboat.com, donghanglin@gmail.com, pg@bowt.ie
Subject: Re: interval_ops shall stop using btequalimage (deduplication)
In-Reply-To: <20231023130710.00.nmisch@google.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox