Re: someone working to add merge? - Mailing list pgsql-hackers

From Jaime Casanova
Subject Re: someone working to add merge?
Date
Msg-id c2d9e70e0511111100i5b6776acsf2cead25022032ff@mail.gmail.com
Whole thread Raw
In response to Re: someone working to add merge?  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: someone working to add merge?  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On 11/11/05, Peter Eisentraut <peter_e@gmx.net> wrote:
> Tom Lane wrote:
> > If you don't have any better idea how to do it than a full table
> > lock, you might as well not do it at all.  A "proof of concept" that
> > doesn't solve the hard part of the problem is no proof :-(
>
> But the problem here is not to break any kind of performance barrier,
> but to give people migrating from MySQL and alternative for REPLACE
> command.
>

But MERGE isn't REPLACE...

REPLACE will delete old records to insert new ones; MERGE try to
insert and if the record exists then can UPDATE just a few values,
maybe incrementing them with a value (all the calculation are doing by
the MERGE)


> > My first guess about a real implementation would involve extending
> > the index AM API to offer a function "insert this key, or return the
> > existing match if there already is one".
>
> This assumes that there are indexes defined for the columns involved in
> the merge condition, which is not required anywhere.
>

--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: someone working to add merge?
Next
From: Peter Eisentraut
Date:
Subject: Re: someone working to add merge?