Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 8B31013FA3D6 for ; Mon, 18 Jun 2012 11:52:49 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SgdJw-0003GE-Qp for pgsql-performance@postgresql.org; Mon, 18 Jun 2012 14:52:49 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q5IEqZdu009675; Mon, 18 Jun 2012 10:52:35 -0400 (EDT) From: Tom Lane To: =?KOI8-U?B?96bUwcymyiD0yc3eydvJzg==?= cc: pgsql-performance@postgresql.org Subject: Re: correlated exists with join is slow. In-reply-to: References: Comments: In-reply-to =?KOI8-U?B?96bUwcymyiD0yc3eydvJzg==?= message dated "Mon, 18 Jun 2012 16:47:42 +0300" Date: Mon, 18 Jun 2012 10:52:35 -0400 Message-ID: <9674.1340031155@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/96 X-Sequence-Number: 47122 =?KOI8-U?B?96bUwcymyiD0yc3eydvJzg==?= writes: > Today I've found a query that I thought will be fast turned out to be slow. > The problem is correlated exists with join - it does not want to make > correlated nested loop to make exists check. 9.2 will make this all better. These are exactly the type of case where you need the "parameterized path" stuff. regards, tom lane