Re: WIP: Access method extendability

From: Petr Jelinek <petr(at)2ndquadrant(dot)com>
To: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Teodor Sigaev <teodor(at)sigaev(dot)ru>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WIP: Access method extendability
Date: 2016-03-09 01:56:36
Message-ID: 56DF82D4.7090600@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I went over the latest version of this, here are my notes.

create-am.9:

+ case DO_ACCESS_METHOD:
+ snprintf(buf, bufsize,
+ "");
+ return;

Missing the actual description.

+ appendPQExpBuffer(q, "CREATE ACCESS METHOD %s HANDLER %s;\n",
+ qamname, aminfo->amhandler);

Generates invalid syntax (missing TYPE).

I don't like that you hardcode 'i' everywhere in the code as am type
index. It would be better to define it in pg_am.h and use that.

I was also debating in my head if amtype is correct name as it maps to
relkind so amkind might be better name for the column, otoh then it
won't map to the syntax we have agreed on for CREATE ACCESS METHOD so I
guess there is no ideal name here.

object_type_map record is missing, as is getObjectTypeDescription and
getObjectIdentityParts support

(you can check what I sent as part of sequence access methods where I
fixed these things, otherwise it reuses most of your code)

generic-xlog.9:
Not much to say here, the api makes sense to me, it will have
performance impact but don't see how we can do this generically without
callbacks to extension in any better way.

One thing I don't understand is why there is support for unlogged
relations. Shouldn't that be handled by whoever is using this to
actually not call this at all? It's just call to RelationNeedsWAL()
nothing to hard and hidden magic like not doing anything with WAL for
the unlogged tables is seldomly good idea.

Another small thing is that we put the API explanation comments into .c
file not .h file.

Didn't look at the bloom index too deeply yet.

--
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 Langote 2016-03-09 02:01:06 Re: [PROPOSAL] VACUUM Progress Checker.
Previous Message Tom Lane 2016-03-09 01:56:29 Re: Managing a long-held TupleDesc reference