pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: BRIN minmax multi - incorrect distance for infinite timestamp/date
Date: Wed, 18 Oct 2023 16:29:47 +0200
Message-ID: <21465bdd-5b6d-6071-aa89-ce77e6f3cdb1@enterprisedb.com> (raw )
In-Reply-To: <CAEZATCXSG0=NK67AhhED+25qXRAJDJqSGPOUY1zdopurTc+QjA@mail.gmail.com >
References: <eef0ea8c-4aaa-8d0d-027f-58b1f35dd170@enterprisedb.com >
<CAEZATCWwqTdcBC1ee1uLp+KG4XZLmxFwEGX9y9sBLUR+OdQHeA@mail.gmail.com >
<14c205c6-fbf4-d2f2-3ea8-a7d5c5d63180@enterprisedb.com >
<CAEZATCUNjgmTfTJnkR+DMXfRbrm+bqJuEZ-fKRJF3X4mr=o3LQ@mail.gmail.com >
<75de1895-3bd9-242e-cf13-3f5b0281e676@enterprisedb.com >
<CAEZATCV0kY0gWCLChf_x_Drh4KUEKcmBPD+cggcSju6yHaRYYA@mail.gmail.com >
<CAExHW5tsrfu3k5We1tr_ANaQ_0OJc6Zf2YMB+TkmB2PQwirAPQ@mail.gmail.com >
<dd7fcf77-414b-b4b2-358a-0fc505255fba@enterprisedb.com >
<CAExHW5vcq6mJJRH3wPytDataDw+HZgs-E7b=e+SXpWgo7BoTsg@mail.gmail.com >
<31400145-6f71-a6b2-e371-048a8e1584ef@enterprisedb.com >
<CAEZATCXSG0=NK67AhhED+25qXRAJDJqSGPOUY1zdopurTc+QjA@mail.gmail.com >
On 10/18/23 12:13, Dean Rasheed wrote:
> On Tue, 17 Oct 2023 at 21:25, Tomas Vondra
> <tomas.vondra@enterprisedb.com> wrote:
>>
>> Here's a couple cleaned-up patches fixing the various discussed here.
>> I've tried to always add a regression test demonstrating the issue
>> first, and then fix it in the next patch.
>>
>
> This looks good to me.
>
>> 2) incorrect subtraction in distance for date values (0003)
>>
>> All the problems except "2" have been discussed earlier, but this seems
>> a bit more serious than the other issues, as it's easier to hit. It
>> subtracts the values in the opposite order (smaller - larger), so the
>> distances are negated. Which means we actually merge the values from the
>> most distant ones, and thus are "guaranteed" to build very a very
>> inefficient summary.
>>
>
> Yeah, that's not good. Amusingly this accidentally made infinite dates
> behave correctly, since they were distance 0 away from anything else,
> which was larger than all the other negative distances! But yes, that
> needed fixing properly.
>
Right. Apparently two wrongs can make a right, after all ;-)
regards
--
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
view thread (27+ messages) latest in thread
Message-ID: <21465bdd-5b6d-6071-aa89-ce77e6f3cdb1@enterprisedb.com>
Permalink: ../21465bdd-5b6d-6071-aa89-ce77e6f3cdb1@enterprisedb.com/
Also on: postgresql.org/message-id/21465bdd-5b6d-6071-aa89-ce77e6f3cdb1@enterprisedb.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: tomas.vondra@enterprisedb.com, dean.a.rasheed@gmail.com, ashutosh.bapat.oss@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: BRIN minmax multi - incorrect distance for infinite timestamp/date
In-Reply-To: <21465bdd-5b6d-6071-aa89-ce77e6f3cdb1@enterprisedb.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