Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 3ACCA632B82 for ; Sun, 10 Jan 2010 06:51:40 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 03695-10 for ; Sun, 10 Jan 2010 10:51:24 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from 63.mail-out.ovh.net (63.mail-out.ovh.net [91.121.185.56]) by mail.postgresql.org (Postfix) with SMTP id 3FA4863244E for ; Sun, 10 Jan 2010 06:51:29 -0400 (AST) Received: (qmail 22398 invoked by uid 503); 10 Jan 2010 10:52:00 -0000 Received: from b6.ovh.net (HELO mail609.ha.ovh.net) (213.186.33.56) by 63.mail-out.ovh.net with SMTP; 10 Jan 2010 10:52:00 -0000 Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 10 Jan 2010 10:51:26 -0000 Received: from par69-8-88-161-102-87.fbx.proxad.net (HELO soyouz) (88.161.102.87) by ns0.ovh.net with SMTP; 10 Jan 2010 10:51:24 -0000 Date: Sun, 10 Jan 2010 11:52:01 +0100 To: "Hannu Krosing" , Nickolay Subject: Re: PG optimization question From: =?utf-8?Q?Pierre_Fr=C3=A9d=C3=A9ric_Caillau?= =?utf-8?Q?d?= Cc: pgsql-performance@postgresql.org Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <4B485975.70506@zhukcity.ru> <2f4958ff1001090418i78dee992t5ff2d78a54187c07@mail.gmail.com> <4B4879A0.2060703@zhukcity.ru> <20100109124646.GA8123@it.is.rice.edu> <4B487D9C.9020507@zhukcity.ru> <4B48CFDF.7090406@zhukcity.ru> <1263075977.6481.9.camel@hvost> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <1263075977.6481.9.camel@hvost> User-Agent: Opera Mail/9.62 (Linux) X-Ovh-Tracer-Id: 12766579044444473068 X-Ovh-Remote: 88.161.102.87 (par69-8-88-161-102-87.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|U 0.5/N X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.323 tagged_above=-10 required=5 tests=AWL=-1.138, BAYES_40=-0.185 X-Spam-Level: X-Archive-Number: 201001/173 X-Sequence-Number: 37053 > If you transfer (delete from staging, insert into archive) in one > transaction , then it will be always visible in exactly one of them, > and exatly once in a view over both staging and archive(s). Does the latest version implement this : INSERT INTO archive (...) DELETE FROM staging WHERE ... RETURNING ...