Re: [PoC] Asynchronous execution again (which is not parallel)
От | Kyotaro HORIGUCHI |
---|---|
Тема | Re: [PoC] Asynchronous execution again (which is not parallel) |
Дата | |
Msg-id | 20160126.182312.141662350.horiguchi.kyotaro@lab.ntt.co.jp обсуждение исходный текст |
Ответ на | Re: [PoC] Asynchronous execution again (which is not parallel) (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>) |
Список | pgsql-hackers |
Hi. At Thu, 21 Jan 2016 19:09:19 +0900, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote in <56A0AE4F.9000508@lab.ntt.co.jp> > > Hi! > > On 2016/01/21 18:26, Kyotaro HORIGUCHI wrote: > >>> Then, suppose we add a function bool ExecStartAsync(PlanState *target, > >>> ExecCallback callback, PlanState *cb_planstate, void *cb_context). > >>> For non-async-aware plan nodes, this just returns false. async-aware > >>> plan nodes should initiate some work, register some callbacks, and > >>> return. The callback that get registered should arrange in turn to > >>> register the callback passed as an argument when a tuple becomes > >>> available, passing the planstate and context provided by > >>> ExecStartAsync's caller, plus the TupleTableSlot containing the tuple. > >> > >> Although I don't imagine clearly about the case of > >> async-aware-nodes under non-aware-nodes, it seems to have a high > >> affinity with (true) parallel execution framework. > > > > The ExecStartAsync is similar to ExecStartNode of my old > > patch. One of the most annoying things of that is that it needs > > to walk down to their descendents and in turn it needs garbageous > > corresponding additional codes for all type of nodes which can > > have children. > > Unless I am missing something, I wonder if this is where > planstate_tree_walker() introduced by commit 8dd401aa is useful. For > example, I see that it's used in ExecShutdownNode() in a manner that looks > interesting for this discussion. Oh, that's a part of parallel execution sutff. Thanks for letting me know of that. The walker approach also fits to kick functions that most types of node is unrelated. Only one (or two, including ForeignScan) types of nodes are involved. The attached patches have the same functionality but using planstate_tree_walker instead of callbacks. This seems further simpler the callbacks. regards, -- Kyotaro Horiguchi NTT Open Source Software Center
В списке pgsql-hackers по дате отправления: