Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 011F0B5DBD3 for ; Mon, 16 May 2011 20:22:56 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 05059-09 for ; Mon, 16 May 2011 23:22:49 +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 0883DB5D94C for ; Mon, 16 May 2011 20:22:48 -0300 (ADT) 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 p4GNMm2n023923; Mon, 16 May 2011 19:22:48 -0400 (EDT) To: Clemens Eisserer cc: pgsql-performance@postgresql.org Subject: Re: hash semi join caused by "IN (select ...)" In-reply-to: References: Comments: In-reply-to Clemens Eisserer message dated "Tue, 17 May 2011 00:30:22 +0200" Date: Mon, 16 May 2011 19:22:48 -0400 Message-ID: <23922.1305588168@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: 201105/252 X-Sequence-Number: 43761 Clemens Eisserer writes: > I have a quite complex, performance sensitive query in a system with a > few (7) joins: > select .... from t1 left join t2 .... WHERE id IN (select ....) Does it work as expected with one less join? If so, try increasing join_collapse_limit ... regards, tom lane