Re: WIP: Rework access method interface
От | Amit Kapila |
---|---|
Тема | Re: WIP: Rework access method interface |
Дата | |
Msg-id | CAA4eK1JJc7VbwAf9VdO4Ch7MrNC97EcBF+rD-RKgOCHeWO0nUA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: WIP: Rework access method interface (Teodor Sigaev <teodor@sigaev.ru>) |
Список | pgsql-hackers |
On Fri, Sep 25, 2015 at 7:41 PM, Teodor Sigaev <teodor@sigaev.ru> wrote:
I'm OK about continuing work on amvalidate if we can build consuensus on its design.
Could you give some feedback on amvalidate version of patch please?
http://www.postgresql.org/message-id/CAPpHfds8ZyWenz9vW6tE5RZXboL1vU_wSW181vEq+mU+v1dsiw@mail.gmail.com
In attach a bit modified patch based on 4-th version, and if there are no strong objections, I will commit it. Waiting this patch stops Alexander's development on CREATE ACCESS METHOD and he needs to move forward.
1.
+InitIndexAmRoutine(Relation relation)
+{
+ IndexAmRoutine *result, *tmp;
+
+ result = (IndexAmRoutine *)MemoryContextAlloc(CacheMemoryContext,
+ sizeof(IndexAmRoutine));
+ tmp = (IndexAmRoutine *)DatumGetPointer(
+ OidFunctionCall0(relation->rd_am->amhandler));
+ memcpy(result, tmp, sizeof(IndexAmRoutine));
+ relation->amroutine = result;
+}
Is it appropriate to use CacheMemoryContext here?
Currently in load_relcache_init_file(), all the other information
like rd_indoption, rd_aminfo in Relation is allocated in indexcxt
which ofcourse in allocated in CacheMemoryContext, but still is
there a reason why this also shouldn't be allocated in same
context.
2.
- aform = (Form_pg_am) MemoryContextAlloc(CacheMemoryContext, sizeof *aform);
+ aform = (Form_pg_am)MemoryContextAlloc(CacheMemoryContext, sizeof *aform);
Spurious change.
В списке pgsql-hackers по дате отправления: