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.linnakangas@enterprisedb.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