On Wed, Nov 16, 2005 at 11:06:15AM -0800, Dann Corbit wrote: > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:pgsql-hackers- > > [EMAIL PROTECTED] 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.
pgpsVlES6C7e7.pgp
Description: PGP signature