Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id CDC2A1337C0A for ; Wed, 23 Mar 2011 18:00:51 -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 78617-05 for ; Wed, 23 Mar 2011 21:00:42 +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 D82321337BF6 for ; Wed, 23 Mar 2011 18:00:24 -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 p2NL042C004287; Wed, 23 Mar 2011 17:00:04 -0400 (EDT) To: Claudio Freire cc: Josh Berkus , postgres performance list Subject: Re: Shouldn't we have a way to avoid "risky" plans? In-reply-to: References: <4D8A29F2.9080105@agliodbs.com> <4D8A581D.5080704@agliodbs.com> Comments: In-reply-to Claudio Freire message dated "Wed, 23 Mar 2011 17:46:19 -0300" Date: Wed, 23 Mar 2011 17:00:04 -0400 Message-ID: <4286.1300914004@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: 201103/296 X-Sequence-Number: 42975 Claudio Freire writes: > On Wed, Mar 23, 2011 at 5:29 PM, Josh Berkus wrote: >> On 3/23/11 10:35 AM, Claudio Freire wrote: >>>  *  consider plan bailout: execute a tempting plan, if it takes too >>> long or its effective cost raises well above the expected cost, bail >>> to a safer plan >> That would actually solve this particular case.  It would still require >> us to have some definition of "safer" though. > In my head, safer = better worst-case performance. If the planner starts operating on the basis of worst case rather than expected-case performance, the complaints will be far more numerous than they are today. regards, tom lane