Re: How to share the result data of separated plan
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Hitoshi Harada <umi.tanuki@gmail.com>
Cc: Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2010-11-08T16:45:53Z
Lists: pgsql-hackers
Hitoshi Harada <umi.tanuki@gmail.com> writes: > But reading closer your response, it occurred to me that ModifyTable > can be the storage to be shared among separated plans instead of newly > invented DtScan. Are you suggesting embed ModifyTable into the main > query, that is also on the top of child plans? In this way we can > still separate plans and scan the result of child plans without much > modification of portal/explain? There is noplace where we need to "scan the result of child plans". We need to scan the set of RETURNING tuples emitted by a child ModifyTable node. That has nothing whatever to do with what it wrote to disk. We would hardly wish to try to reconstruct those tuples from re-reading what it wrote to disk anyway --- that idea fails completely for a DELETE RETURNING subquery, for example. regards, tom lane