I am sending an updated patch. The previous version mistakenly treated
some variations as a single-step statement when it should not have.
Mason
On 11/23/10 3:15 PM, Mason Sharp wrote:
> I am sending this out to allow for feedback.
>
> This patch adds support for INSERT SELECT (including "multi-step"
> queries).
>
> This is done by utilizing COPY. We query the data nodes with the tuples
> being sent to the Coordinator. These are then converted into COPY lines
> and sent back down to the appropriate nodes. (Long term when we add
> data node to data node communication, these can be sent directly).
>
> We also optimize for the case when the SELECT is single-step, the
> destination table is partitioned, the input column value comes from
> the partition column of the source, and there are no limit or offset
> clauses. In this case, we just pass down the INSERT SELECT to the data
> nodes.
>
> There is one kluge here in that I added a static variable for the
> copy state. I did this to avoid having to move the CopyState definition
> to a header file (for usage in execMain.c), in order to make merging
> with vanilla PostgreSQL easier.
>
--
Mason Sharp
EnterpriseDB Corporation
The Enterprise Postgres Company
This e-mail message (and any attachment) is intended for the use of
the individual or entity to whom it is addressed. This message
contains information from EnterpriseDB Corporation that may be
privileged, confidential, or exempt from disclosure under applicable
law. If you are not the intended recipient or authorized to receive
this for the intended recipient, any use, dissemination, distribution,
retention, archiving, or copying of this communication is strictly
prohibited. If you have received this e-mail in error, please notify
the sender immediately by reply e-mail and delete this message.
|