Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id A1C8F1337B8D for ; Mon, 28 Feb 2011 14:57:45 -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 25434-05 for ; Mon, 28 Feb 2011 18:57:38 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id DFFCE1337B47 for ; Mon, 28 Feb 2011 14:57:37 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p1SIvb7c027416; Mon, 28 Feb 2011 13:57:37 -0500 (EST) To: Craig James cc: pgsql-performance@postgresql.org Subject: Re: Query on view radically slower than query on underlying table In-reply-to: <4D6BE95C.3090102@emolecules.com> References: <201102281038.04945.cousinmarc@gmail.com> <4D6B9BC9.1000404@enterprisedb.com> <4D6BE95C.3090102@emolecules.com> Comments: In-reply-to Craig James message dated "Mon, 28 Feb 2011 10:28:44 -0800" Date: Mon, 28 Feb 2011 13:57:36 -0500 Message-ID: <27415.1298919456@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/535 X-Sequence-Number: 42673 Craig James writes: > My guess (and it's just a wild guess) is that the "left join" is > forcing a sequence scan or something. No, that's forcing the other join to be done in toto because it can't reorder the left join and regular join. regards, tom lane