Re: MERGE vs REPLACE
От | Martijn van Oosterhout |
---|---|
Тема | Re: MERGE vs REPLACE |
Дата | |
Msg-id | 20051116193322.GN31063@svana.org обсуждение исходный текст |
Ответ на | Re: MERGE vs REPLACE ("Dann Corbit" <DCorbit@connx.com>) |
Ответы |
Re: MERGE vs REPLACE
|
Список | pgsql-hackers |
On Wed, Nov 16, 2005 at 11:06:15AM -0800, Dann Corbit wrote: > > -----Original Message----- > > From: pgsql-hackers-owner@postgresql.org [mailto:pgsql-hackers- > > owner@postgresql.org] On Behalf Of Simon Riggs > > > Conceptually, a MERGE statement is just a long string of INSERTs and > > > UPDATEs in the same transaction and I think we should treat it as > > > such. > > Merge could also be considered as a long string of deletes and inserts. > I guess that deleting those records that already exist and then > inserting all of the records is faster because it could be done like a > single join to perform the delete and then a single batch insert. And for us it makes no difference because in MVCC, UPDATE == DELETE + INSERT. IMHO it's just a nice construct to specify UPDATEs and INSERTs in the same statement. Have a nice day, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them.
В списке pgsql-hackers по дате отправления: