Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 93C612E0321 for ; Mon, 17 Mar 2008 20:47:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 92646-03 for ; Mon, 17 Mar 2008 20:47:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from momjian.us (momjian.us [70.90.9.53]) by postgresql.org (Postfix) with ESMTP id 520AC2E01E2 for ; Mon, 17 Mar 2008 20:47:13 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id m2HNlCD29489; Mon, 17 Mar 2008 19:47:12 -0400 (EDT) From: Bruce Momjian Message-Id: <200803172347.m2HNlCD29489@momjian.us> Subject: Re: TB-sized databases In-Reply-To: <10359.1197000850@sss.pgh.pa.us> To: Tom Lane Date: Mon, 17 Mar 2008 19:47:12 -0400 (EDT) CC: Ron Mayer , pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/360 X-Sequence-Number: 29314 I have _not_ added a TODO for this item. Let me know if one is needed. --------------------------------------------------------------------------- Tom Lane wrote: > Ron Mayer writes: > > Tom Lane wrote: > >> There's something fishy about this --- given that that plan has a lower > >> cost estimate, it should've picked it without any artificial > >> constraints. > > > I think the reason it's not picking it was discussed back in this thread > > too. > > http://archives.postgresql.org/pgsql-performance/2005-03/msg00675.php > > http://archives.postgresql.org/pgsql-performance/2005-03/msg00684.php > > My offset 0 is forcing the outer join. > > [Edit: Ugh - meant cartesian join - which helps this kind of query.] > > Ah; I missed the fact that the two relations you want to join first > don't have any connecting WHERE clause. > > The concern I mentioned in the above thread was basically that I don't > want the planner to go off chasing Cartesian join paths in general --- > they're usually useless and would result in an exponential explosion > in the number of join paths considered in many-table queries. > > However, in this case the reason that the Cartesian join might be > relevant is that both of them are needed in order to form an inner > indexscan on the big table. I wonder if we could drive consideration > of the Cartesian join off of noticing that. It'd take some rejiggering > around best_inner_indexscan(), or somewhere in that general vicinity. > > Way too late for 8.3, but something to think about for next time. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 7: You can help support the PostgreSQL project by donating at > > http://www.postgresql.org/about/donate -- Bruce Momjian http://momjian.us EnterpriseDB http://postgres.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +