X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C3DF3D1B215 for ; Mon, 28 Jun 2004 02:48:53 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 63207-07 for ; Mon, 28 Jun 2004 05:48:52 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id D5C69D1B1D9 for ; Mon, 28 Jun 2004 02:48:50 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i5S5miwL018212; Mon, 28 Jun 2004 01:48:44 -0400 (EDT) To: Klint Gore Cc: pgsql-performance@postgresql.org Subject: Re: SQL stupid query plan... terrible performance ! In-reply-to: <40DFACD5345.1020KG@129.180.47.120> References: <40DF684D.9060207@wp.pl> <16908.1088393386@sss.pgh.pa.us> <40DFACD5345.1020KG@129.180.47.120> Comments: In-reply-to Klint Gore message dated "Mon, 28 Jun 2004 15:29:57 +1000" Date: Mon, 28 Jun 2004 01:48:43 -0400 Message-ID: <18211.1088401723@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/273 X-Sequence-Number: 7331 Klint Gore writes: > On Sun, 27 Jun 2004 23:29:46 -0400, Tom Lane wrote: >> [yawn...] Cast the constants to bigint. See previous discussions. > Would there be any way of adding some sort of indicator to the plan as > to why sequential was chosen? Not really ... the plan that's presented is the one that looked the cheapest out of the feasible plans. How are you going to identify a single reason as to why any other plan was not generated or lost out on a cost-estimate basis? Humans might be able to do so (note that the above quote is an off-the-cuff estimate, not something I'd care to defend rigorously) but I don't think software can do it. FWIW, the particular problem here should be fixed in 7.5. regards, tom lane