Re: BRIN indexes - TRAP: BadArgument

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Erik Rijkers <er(at)xs4all(dot)nl>, Emanuel Calvo <3manuek(at)esdebian(dot)org>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Nicolas Barbier <nicolas(dot)barbier(at)gmail(dot)com>, Claudio Freire <klaussfreire(at)gmail(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: BRIN indexes - TRAP: BadArgument
Date: 2014-11-10 21:31:23
Message-ID: 20141110213123.GK1791@alvin.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Stark wrote:

> 1) The manual describes the exensibility API including the BrinOpcInfo
> struct -- but it doesn't define the BrinDesc struct that every API
> method takes. It's not clear what exactly that argument is for or how
> to make use of it.

Hm, I guess this could use some expansion.

> 2) The mention about additional opclass operators and to number them
> from 11 up is fine -- but there's no explanation of how to decide what
> operators need to be explicitly added like that. Specifically I gather
> from reading minmax that = is handled internally by Brin and you only
> need to add any other operators aside from = ? Is that right?

I think I already replied to this in the other email.

> 3) It's not entirely clear in the docs when each method is will be
> invoked. Specifically it's not clear whether opcInfo is invoked once
> when the index is defined or every time the definition is loaded to be
> used. I gather it's the latter? Perhaps there needs to be a method
> that's invoked specifically when the index is defined? I'm wondering
> where I'm going to hook in the logic to determine the size and number
> of hash functions to use for the bloom filter which needs to be
> decided once when the index is created and then static for the index
> in the future.

Every time the index is accessed, yeah. I'm not sure about figuring the
initial creation details. Do you think we need another support
procedure to help with that? We can add it if needed; minmax would just
define it to InvalidOid.

> 4) It doesn't look like BRIN handles cross-type operators at all.

The idea here is that there is a separate opclass to handle cross-type
operators, which would be together in the same opfamily as the opclass
used to create the index. I haven't actually tried this yet, mind you.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-11-10 21:58:15 Re: pg_background (and more parallelism infrastructure patches)
Previous Message Alvaro Herrera 2014-11-10 21:26:03 Re: BRIN indexes - TRAP: BadArgument