Re: ask for review of MERGE - Mailing list pgsql-hackers

From Stefan Kaltenbrunner
Subject Re: ask for review of MERGE
Date
Msg-id 4CC1AF37.9070704@kaltenbrunner.cc
Whole thread Raw
In response to Re: ask for review of MERGE  (Greg Smith <greg@2ndquadrant.com>)
List pgsql-hackers
On 10/21/2010 08:36 PM, Greg Smith wrote:
> Robert Haas wrote:
>> I think the right way to write UPSERT is something
>> along the lines of:
>>
>> MERGE INTO Stock t USING (VALUES (10, 1)) s(item_id, balance) ON
>> s.item_id = t.item_id ...

[...]

> Here's what the query plan looks like on a MATCH:
>
> Merge (cost=0.00..8.29 rows=1 width=22) (actual time=0.166..0.166 rows=0
> loops=1)
> Action 1: Update When Matched
> Action 2: Insert When Not Mactched

"Mactched"? - is this a c&p error or the actual output of EXPLAIN? :)


lg


Stefan


pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: Extensions, this time with a patch
Next
From: Alvaro Herrera
Date:
Subject: Re: Extensions, this time with a patch