Re: Asynchronous execution on FDW - Mailing list pgsql-hackers

From Kyotaro HORIGUCHI
Subject Re: Asynchronous execution on FDW
Date
Msg-id 20150723.102524.261768417.horiguchi.kyotaro@lab.ntt.co.jp
Whole thread Raw
In response to Re: Asynchronous execution on FDW  (Kouhei Kaigai <kaigai@ak.jp.nec.com>)
Responses Re: Asynchronous execution on FDW
List pgsql-hackers
Hello,

> Let me ask an elemental question.
> 
> If we have ParallelAppend node that kicks a background worker process for
> each underlying child node in parallel, does ForeignScan need to do something
> special?

Although I don't see the point of the background worker in your
story but at least for ParalleMergeAppend, it would frequently
discontinues to scan by upper Limit so one more state, say setup
- which mans a worker is allocated but not started- would be
useful and the driver node might need to manage the number of
async execution. Or the driven nodes might do so inversely.

As for ForeignScan, it is merely an API for FDW and does nothing
substantial so it would have nothing special to do. As for
postgres_fdw, current patch restricts one execution per one
foreign server at once by itself. We would have to provide
another execution management if we want to have two or more
simultaneous scans per one foreign server at once.

Sorry for the focusless discussion but does this answer some of
your question?

> Expected waste of CPU or I/O is common problem to be solved, however, it does
> not need to add a special case handling to ForeignScan, I think.
> How about your opinion?

I agree with you that ForeignScan as the wrapper for FDWs don't
need anything special for the case. I suppose for now that
avoiding the penalty from abandoning too many speculatively
executed scans (or other works on bg worker like sorts) would be
a business of the upper node of FDWs, or somewhere else.

However, I haven't dismissed the possibility that some common
works related to resource management could be integrated into
executor (or even into planner), but I see none for now.

regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



pgsql-hackers by date:

Previous
From: Fabrízio de Royes Mello
Date:
Subject: Re: Add CINE for ALTER TABLE ... ADD COLUMN
Next
From: dinesh kumar
Date:
Subject: Re: [PATCH] SQL function to report log message