Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 587AA24D547 for ; Thu, 10 Nov 2011 11:43:05 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 37226-01 for ; Thu, 10 Nov 2011 15:42:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail-vw0-f46.google.com (mail-vw0-f46.google.com [209.85.212.46]) by mail.postgresql.org (Postfix) with ESMTP id 59A1524D546 for ; Thu, 10 Nov 2011 11:42:56 -0400 (AST) Received: by vws1 with SMTP id 1so2482634vws.19 for ; Thu, 10 Nov 2011 07:42:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=0ovyHKwuahyXFnzeOZB5kKDwHQ7SzzmrUEROIJTabfQ=; b=aN1nPbMOp6jAIiJcA4oGhfnE9nBa+liD0rirgLFOFbgzOm8HxjtterNte1bB5fmTUu 03DbqYjCG7QmRlfWOFIbDLzBTpJieo5OH9d7pPMLu5D85y+LUVyAJata46AAHZzxhoL/ cV2Q/2D7wLLO6zraLMVHon65sEESjWseUEbIY= Received: by 10.52.33.50 with SMTP id o18mr13572651vdi.42.1320939776747; Thu, 10 Nov 2011 07:42:56 -0800 (PST) Received: from speedbook-air.home.jay.fm (home.jay.fm. [173.166.48.118]) by mx.google.com with ESMTPS id dw3sm12633654vdb.16.2011.11.10.07.42.55 (version=SSLv3 cipher=OTHER); Thu, 10 Nov 2011 07:42:56 -0800 (PST) Message-ID: <4EBBF0FD.5050506@gmail.com> Date: Thu, 10 Nov 2011 10:42:53 -0500 From: Jay Levitt User-Agent: Postbox 3.0.1 (Macintosh/20111102) MIME-Version: 1.0 To: Tom Lane CC: Kevin Grittner , Merlin Moncure , pgsql-performance@postgresql.org Subject: Re: Subquery in a JOIN not getting restricted? References: <4EB84CB4.2010102@gmail.com> <4EB7FEFD0200002500042B1C@gw.wicourts.gov> <4EB80CAA0200002500042B3B@gw.wicourts.gov> <4EB86784.7080209@gmail.com> <4EB88C5A.2020704@gmail.com> <4EBA44B70200002500042BC8@gw.wicourts.gov> <4EBA8C100200002500042C23@gw.wicourts.gov> <4EBBD717.80507@gmail.com> <8071.1320938568@sss.pgh.pa.us> In-Reply-To: <8071.1320938568@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201111/133 X-Sequence-Number: 45644 > Don't hold your breath waiting for that to change. To do what you're > wishing for, we'd have to treat the GROUP BY subquery as if it were an > inner indexscan, and push a join condition into it. That's not even > possible today. Thanks! Knowing "that's not a thing" helps; we'll just have to rephrase the query. Jay