Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 25AF56331E6 for ; Sun, 10 Jan 2010 14:45:46 -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 90742-05 for ; Sun, 10 Jan 2010 18:45:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by mail.postgresql.org (Postfix) with ESMTP id 788736325AB for ; Sun, 10 Jan 2010 14:45:34 -0400 (AST) Received: by fg-out-1718.google.com with SMTP id 22so447875fge.1 for ; Sun, 10 Jan 2010 10:45:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=HGbwWxd+liCo75XAFvMKYwHWa1PvRmcTMACsBF7Hk30=; b=nRFnr3eEMye6WCF/0XAIZ1rLQsHLZqFHR6f9gMWe9l8cYUpG0MEaqKQ9EXLr24yK0N UE4iq36VgzatohqL+wg0VpEQNjzySd3OKoRE5alz8QTVPJBTf9nhBUQGXrCBAgELFCa6 mN29uL8l0EUVVTRnp65ExA+6dJCnk5jWn3PGI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=kI4ByD0Ldbjwhf9CX4c2x6RpFzqj8equfsoNmYKxRzbUTZNOz7hsP/aoVrtPdru+ey b+R4TI/LOMGAm6B7Fu65GE4/ELSaawKog9sBj3D7WzmrxoSPZll3TECFW6amW9fF1TqD 9lu+v2S7IE3H1hYZqPG2A9FAcKFfdsYalH92g= MIME-Version: 1.0 Received: by 10.239.187.194 with SMTP id m2mr1136219hbh.113.1263149132685; Sun, 10 Jan 2010 10:45:32 -0800 (PST) In-Reply-To: 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> Date: Sun, 10 Jan 2010 13:45:32 -0500 Message-ID: <603c8f071001101045wb99b337j3e1dabe9ead97421@mail.gmail.com> Subject: Re: PG optimization question From: Robert Haas To: =?ISO-8859-1?Q?Pierre_Fr=E9d=E9ric_Caillaud?= Cc: Hannu Krosing , Nickolay , pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.419 tagged_above=-10 required=5 tests=AWL=0.180, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201001/180 X-Sequence-Number: 37060 2010/1/10 Pierre Fr=E9d=E9ric Caillaud : > >> 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). > > =A0 =A0 =A0 =A0Does the latest version implement this : > > INSERT INTO archive (...) DELETE FROM staging WHERE ... RETURNING ... No. There are no plans to support that, though there are proposals to supp= ort: WITH x AS (DELETE FROM staging WHERE ... RETURNING ...) INSERT INTO archive (...) SELECT ... FROM x I'm not sure how much that will help though since, in the designs so far discused, the tuples won't be pipelined. ...Robert