Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D2BB463518D for ; Thu, 20 Aug 2009 18:59:32 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 90191-07 for ; Thu, 20 Aug 2009 21:59:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f216.google.com (mail-ew0-f216.google.com [209.85.219.216]) by mail.postgresql.org (Postfix) with ESMTP id 7CD006350FE for ; Thu, 20 Aug 2009 18:59:22 -0300 (ADT) Received: by ewy12 with SMTP id 12so262720ewy.24 for ; Thu, 20 Aug 2009 14:59:20 -0700 (PDT) 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=coDilTyBbQJC8F6Ua9HmHIS7t24DjV+YFgV3OeCYAVw=; b=bxag1gjjrYx8NFc6hbXeGxYrJPLM5vHWGPPUhLVLY197vQ8jJGepHmUOgEMe/1wY+i PUpQhPn0GYp+NOBQylC0IIk8fWm9PxDgcs9Zf+IuZ7rxpzulyoL1jPaNFwuEhFHI7O4y oe8XdCOOG07Io64Cp/V3QPgd97DijpC0OapcU= 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=P6ARhcskzwOEakaxVgLlFStJiVEfIRBiyEAAVddwW0nNlavc2IW6c2HWLQG4i+8PAX 05iF84fOj92KZcX+1G+UXhYgDtuk37pkP4VcUgtc6c6i9o8SahNhubuWo9oNMYrgRj+O Ej5kTfEWGVCYlFfQC5EYvia6ppLGnYlfViHm4= MIME-Version: 1.0 Received: by 10.211.148.2 with SMTP id a2mr331163ebo.68.1250805560633; Thu, 20 Aug 2009 14:59:20 -0700 (PDT) In-Reply-To: <33b743250908201416h3ec8b61cp4976ab540c4e7cee@mail.gmail.com> References: <33b743250908201332k5e7b0e3fga71a1ec6b44f302a@mail.gmail.com> <4A8DB4D7.6030102@noaa.gov> <33b743250908201416h3ec8b61cp4976ab540c4e7cee@mail.gmail.com> Date: Thu, 20 Aug 2009 15:59:20 -0600 Message-ID: Subject: Re: Rewrite without correlated subqueries From: Scott Marlowe To: bricklen Cc: Mark Fenbers , pgsql-sql@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/117 X-Sequence-Number: 33026 On Thu, Aug 20, 2009 at 3:16 PM, bricklen wrote: > Interesting idea. Preferably this operation could be done in straight SQL in > a single transaction, to fit in with the way our application works, but if > that's not possible I may need to go the temporary table route. Temp tables can be included in a transaction, and they're not visible to other connections.