Re: WIP: BRIN multi-range indexes - Mailing list pgsql-hackers

From Andres Freund
Subject Re: WIP: BRIN multi-range indexes
Date
Msg-id 20180302035538.gkqgtcv6kmn2cklw@alap3.anarazel.de
Whole thread Raw
In response to Re: WIP: BRIN multi-range indexes  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: WIP: BRIN multi-range indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

On 2018-02-25 01:30:47 +0100, Tomas Vondra wrote:
> Note: Currently, this only works with float8-based data types.
> Supporting additional data types is not a big issue, but will
> require extending the opclass with "subtract" operator (used to
> compute distance between values when merging ranges).

Based on Tom's past stances I'm a bit doubtful he'd be happy with such a
restriction.  Note that something similar-ish also has come up in
0a459cec96.

I kinda wonder if there's any way to not have two similar but not equal
types of logic here?

    That problem is
    resolved here by adding the ability for btree operator classes to provide
    an "in_range" support function that defines how to add or subtract the
    RANGE offset value.  Factoring it this way also allows the operator class
    to avoid overflow problems near the ends of the datatype's range, if it
    wishes to expend effort on that.  (In the committed patch, the integer
    opclasses handle that issue, but it did not seem worth the trouble to
    avoid overflow failures for datetime types.)


- Andres


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: zheap: a new storage format for PostgreSQL
Next
From: Thomas Munro
Date:
Subject: Re: [HACKERS] GSoC 2017: weekly progress reports (week 4) and patchfor hash index