Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 16DDE989B51 for ; Wed, 11 Jan 2012 12:07:42 -0400 (AST) Received: from mail.fmed.uba.ar ([157.92.152.1]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Rl0iB-0005Xe-3m for pgsql-sql@postgresql.org; Wed, 11 Jan 2012 16:07:41 +0000 Received: from [157.92.152.105] (unknown [157.92.152.105]) by mail.fmed.uba.ar (Postfix) with ESMTP id DC3ED4A4BDB; Wed, 11 Jan 2012 13:03:11 -0200 (ARST) Subject: Re: amount of join's and sequential access to the tables involved From: Gerardo Herzig To: Tom Lane Cc: pgsql-sql@postgresql.org In-Reply-To: <20152.1326296428@sss.pgh.pa.us> References: <1326296192.24629.12.camel@inca.fmed.uba.ar> <20152.1326296428@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" Date: Wed, 11 Jan 2012 13:06:34 -0300 Message-ID: <1326297994.28802.6.camel@inca.fmed.uba.ar> Mime-Version: 1.0 X-Mailer: Evolution 2.30.1.2 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201201/39 X-Sequence-Number: 36210 El mi=C3=A9, 11-01-2012 a las 10:40 -0500, Tom Lane escribi=C3=B3: > Gerardo Herzig writes: > > Hi all. Im working on a 'simple' query with 7, 8 left joins. After th= e > > 9nth join or so, explain analyze became to show the plan with many > > tables being read in sequential fashion. Of course, this slows down t= he > > query response in a factor on 10. >=20 > increase join_collapse_limit, perhaps? >=20 > regards, tom lane >=20 Crap, yes. That was it. Just curious about one thing: That query is part of a function. If i raise set_join_collapse in a psql bash session, and then excecute the function, there is no changes. But if i excecute the query directly in the psql session, it flys. So, what happens, when a plsql function is excecuted, it takes is own enviroment variables, or something like that? Thanks again, Tom! Gerardo