Re: BRIN minmax multi - incorrect distance for infinite timestamp/date - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: BRIN minmax multi - incorrect distance for infinite timestamp/date
Date
Msg-id 31400145-6f71-a6b2-e371-048a8e1584ef@enterprisedb.com
Whole thread Raw
In response to Re: BRIN minmax multi - incorrect distance for infinite timestamp/date  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
Responses Re: BRIN minmax multi - incorrect distance for infinite timestamp/date
Re: BRIN minmax multi - incorrect distance for infinite timestamp/date
Re: BRIN minmax multi - incorrect distance for infinite timestamp/date
List pgsql-hackers
Hi,

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.

In particular, this deals with these issues:

1) overflows in distance calculation for large timestamp values (0002)

2) incorrect subtraction in distance for date values (0003)

3) incorrect distance for infinite date/timestamp values (0005)

4) failing distance for extreme interval values (0007)

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. People with multi-minmax indexes on "date" columns
probably will need to reindex.


regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Attachment

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: [PoC/RFC] Multiple passwords, interval expirations
Next
From: Jelte Fennema
Date:
Subject: Re: run pgindent on a regular basis / scripted manner