Re: WIP: Rework access method interface

From: Petr Jelinek <petr(at)2ndquadrant(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Teodor Sigaev <teodor(at)sigaev(dot)ru>
Cc: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: WIP: Rework access method interface
Date: 2015-09-26 09:55:06
Message-ID: 56066B7A.2010209@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015-09-25 17:45, Alvaro Herrera wrote:
>
> I think the API of getOpFamilyInfo is a bit odd; is the caller expected
> to fill intype and keytype always, and then it only sets the procs/opers
> lists? I wonder if it would be more sensible to have that routine
> receive the pg_opclass tuple (or even the opclass OID) instead of the
> opfamily OID.
>
> I think "amapi.h" is not a great file name. What about am_api.h?
>

Well we have related fdwapi.h and tsmapi.h (and several unrelated *api.h
which also don't use "_" in the name) so amapi.h seems fine to me.

> I'm unsure about BRIN_NPROC. Why did you set it to 15? It's not
> unthinkable that future opclass frameworks will have different numbers

The BRIN_NPROC should be probably defined in brin.c since it's only used
for sizing local array variable in amvalidate and should be used to set
amsupport in the init function as well then.

> of support procs. For BRIN I'm thinking that we could add another
> support proc which validates the opclass definition using the specific
> framework; that way we will be able to check that the set of operators
> defined are correct, etc (something that the current approach cannot
> do).

As I said before in the thread I would prefer more granular approach to
validation - have amvalidateopclass in the struct for the current
functionality so that we can easily add more validators in the future.
There can still be one amvalidate function exposed on SQL level that
just calls all the amvalidate* functions that the am defines.

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2015-09-26 10:06:34 Re: Parallel Seq Scan
Previous Message Amit Kapila 2015-09-26 07:39:54 Re: Parallel Seq Scan