Extensible executor nodes for preparation of SQL/MED

Поиск
Список
Период
Сортировка
От Itagaki Takahiro
Тема Extensible executor nodes for preparation of SQL/MED
Дата
Msg-id AANLkTim+F5uUEyS0OZxjxQ=3B6g2iwSnqXy+qmVHjCX-@mail.gmail.com
обсуждение исходный текст
Ответы Re: Extensible executor nodes for preparation of SQL/MED  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
SQL/MED will have some kinds of planner hooks to support FDW-depending
plan execution. Then, we will need to support user-defined executor nodes.
The proposed SQL/MED has own "executor node hooks" in ForeignTableScan,
  http://wiki.postgresql.org/wiki/SQL/MED#Executor
but I think it will be cleaner to support it in executor level.

The attached patch is an experimental code to do it; Plan struct has
"vtable" field as a set of functions to generate and execute PlanState
nodes. It changes large switch-case blocks in the current executor
into function-pointer calls as like as virtual functions in C++.

Is it worth doing? If we will go to the direction, I'll continue to
research it, like extensibility of Path nodes and EXPLAIN support.

-------- Essence of the patch --------
typedef struct Plan
{
    NodeTag     type;
    PlanVTable *vtable;    /* executor procs */
...

struct PlanVTable
{
    ExecInitNode_type   InitNode;
    ExecProcNode_type   ProcNode;
    MultiProcNode_type  MultiProcNode;
    ExecEndNode_type    EndNode;
...

make_seqscan()
{
    node = makeNode(SeqScan);
    node->vtable = &SeqScanVTable;
...

ExecReScan(node)
{
    node->plan->vtable->ReScan(node);
...

--------


--
Itagaki Takahiro

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Range Types, discrete and/or continuous
Следующее
От: Shigeru HANADA
Дата:
Сообщение: SQL/MED with simple wrappers