From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Mark Dilger <hornschnorter@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-hackers@postgreSQL.org
Subject: Re: WIP: BRIN multi-range indexes
Date: Fri, 2 Mar 2018 18:09:50 +0100
Message-ID: <4d31b358-77d9-c2d7-e0eb-319bda6456ad@2ndquadrant.com> (raw)
In-Reply-To: <18526.1519963686@sss.pgh.pa.us>
References: <20180123200537.gfx5hxcp5k5hktpe@alvherre.pgsql>
<821c4c1d-592e-8916-e323-04607b11777e@2ndquadrant.com>
<c32f9f46-e0ca-0c02-45ec-718dd381f4be@2ndquadrant.com>
<104E8BB8-35FF-4AA8-9871-6AFF04E4CAF3@gmail.com>
<0afde2fc-e160-004f-8fe2-c65302ac3760@2ndquadrant.com>
<22674.1517874015@sss.pgh.pa.us>
<3e924a4c-6ca0-cc10-aebb-5004fc002800@2ndquadrant.com>
<c2523129-a970-97f2-4705-a3b65e21b32f@2ndquadrant.com>
<20180302035538.gkqgtcv6kmn2cklw@alap3.anarazel.de>
<18526.1519963686@sss.pgh.pa.us>
On 03/02/2018 05:08 AM, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
>> 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.
>
That restriction was lifted quite a long time ago, so now both index
types support pretty much the same data types as the original BRIN (with
the reltime/abstime exception, discussed in this thread earlier).
>> I kinda wonder if there's any way to not have two similar but not
>> equal types of logic here?
>
> Hm. I wonder what the patch intends to do with subtraction overflow,
> or infinities, or NaNs. Just as with the RANGE patch, it does not
> seem to me that failure is really an acceptable option. Indexes are
> supposed to be able to index whatever the column datatype can store.
>
I admit that's something I haven't thought about very much. I'll look
into that, of course, but the indexes are only using the deltas to pick
which ranges to merge, so I think in the worst case it may results in
sub-optimal index. But let me check what the RANGE patch did.
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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@2ndquadrant.com, tgl@sss.pgh.pa.us, andres@anarazel.de, hornschnorter@gmail.com, alvherre@alvh.no-ip.org
Subject: Re: WIP: BRIN multi-range indexes
In-Reply-To: <4d31b358-77d9-c2d7-e0eb-319bda6456ad@2ndquadrant.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