Re: BRIN indexes - TRAP: BadArgument - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: BRIN indexes - TRAP: BadArgument
Date
Msg-id 20141029201153.GH1791@alvin.alvh.no-ip.org
Whole thread Raw
In response to Re: BRIN indexes - TRAP: BadArgument  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
Heikki Linnakangas wrote:
> On 10/07/2014 01:33 AM, Alvaro Herrera wrote:

> >I added an USE_ASSERTION-only block in brininsert that runs the union
> >support proc and compares the output with the one from regular addValue.
> >I haven't tested this too much yet.
> 
> Ok, that's better than nothing. I wonder if it's too strict, though. It uses
> brin_tuple_equal(), which does a memcmp() on the tuples. That will trip for
> any non-meaningful differences, like the scale in a numeric.

True.  I'm not real sure how to do better, though.  For types that have
a btree opclass it's easy, because we can just use the btree equality
function to compare the values.  But most interesting cases would not
have btree opclasses; those are covered by the minmax family of
opclasses.

> It would be wise to reserve some more support procedure numbers, for future
> expansion. Currently, support procs 1-4 are used by BRIN itself, and higher
> numbers can be used by the opclass. minmax opclasses uses 5-8 for the <, <=,
> >= and > operators. If we ever want to add a new, optional, support function
> to BRIN, we're out of luck. Let's document that e.g. support procs < 10 are
> reserved for BRIN.

Sure.  I hope we never need to add a seventh optional support function ...

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Petr Jelinek
Date:
Subject: Re: Add shutdown_at_recovery_target option to recovery.conf
Next
From: Robert Haas
Date:
Subject: Re: pg_background (and more parallelism infrastructure patches)