Re: gSoC - ADD MERGE COMMAND - code patch submission

From: Boxuan Zhai <bxzhai2010(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: gSoC - ADD MERGE COMMAND - code patch submission
Date: 2010-07-16 09:26:37
Message-ID: AANLkTilDdZsRzYK7LHUNcTLH-OUE71COer89dtrzyyEG@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

For the EXPLAIN MERGE command, I expect it to return a result similar to
that of a SELECT command.

I think the EXPLAIN command is to show how the tables in a query is scaned
and joined. In my design, the merge command will generate a top-level query
(and plan) as the main query. It is in fact a left join select query over
the source and target tables. This main query (plan) decides how the tables
are scanned. The merge actions will not effect this process. So when we
explain the merge command, a similar result will be returned.

For example the command
EXPLAIN
MERGE INTO Stock USING Sale ON Stock.stock_id = Sale.sale_id
WHEN MATCHED THEN UPDATE SET balance = balance + sale.vol;
WHEN ....
.....

Will return a result just like that of the following command:

EXPLAIN
SELECT * FROM Sale LEFT JOIN Stock ON stock_id = sale_id;

Yours Boxuan.

2010/7/16 Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>

> On 16/07/10 03:26, Boxuan Zhai wrote:
>
>> PS: Heikki asked me about what the "EXPLAIN MERGE ..." command will do.
>> Well, I have not test it, but it may through an error or just explain the
>> top plan, since I put the action plans in a new field, which cannot be
>> recognized by old functions.
>>
>
> I meant what EXPLAIN MERGE output will look like after the project is
> finished, not what it will do at this stage. I was trying to get a picture
> of how you're thinking to implement the executor, what nodes there is in a
> MERGE plan.
>
> --
> Heikki Linnakangas
>
> EnterpriseDB http://www.enterprisedb.com
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-07-16 09:53:23 Re: gSoC - ADD MERGE COMMAND - code patch submission
Previous Message Fujii Masao 2010-07-16 08:34:25 Re: Always truncate segments before unlink