Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 959839FB3B5 for ; Sun, 8 Oct 2006 23:48:12 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 24426-06 for ; Sun, 8 Oct 2006 23:48:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from pro25.abac.com (pro25.abac.com [66.226.64.26]) by postgresql.org (Postfix) with ESMTP id 84B549FB360 for ; Sun, 8 Oct 2006 23:48:08 -0300 (ADT) Received: from [192.168.0.3] (wsip-70-167-125-69.sd.sd.cox.net [70.167.125.69]) (authenticated bits=0) by pro25.abac.com (8.13.8/8.13.8) with ESMTP id k992m3xT098677 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 Oct 2006 19:48:04 -0700 (PDT) (envelope-from cjames@modgraph-usa.com) Message-ID: <4529B7E8.8080606@modgraph-usa.com> Date: Sun, 08 Oct 2006 19:46:00 -0700 From: "Craig A. James" User-Agent: Thunderbird 1.5.0.7 (X11/20060909) MIME-Version: 1.0 To: Mark Kirkwood , pgsql-performance@postgresql.org Subject: Re: Simple join optimized badly? References: <45274A77.7080005@modgraph-usa.com> <18722.1160236300@sss.pgh.pa.us> <5f820f750610071850o6ed0b19o162d65d1987b2a8c@mail.gmail.com> <200610081605.03501.josh@agliodbs.com> <4529A0CA.8000904@modgraph-usa.com> <4529B6D0.2010206@paradise.net.nz> In-Reply-To: <4529B6D0.2010206@paradise.net.nz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.081 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200610/149 X-Sequence-Number: 21278 Mark Kirkwood wrote: >> The result? I can't use my function in any WHERE clause that involves >> any other conditions or joins. Only by itself. PG will occasionally >> decide to use my function as a filter instead of doing the join or the >> other WHERE conditions first, and I'm dead. > > this is an argument for cost-for-functions rather than hints AFAICS. Perhaps you scanned past what I wrote a couple paragraphs farther down. I'm going to repeat it because it's the KEY POINT I'm trying to make: Craig James wrote: > Now you might argue that function-cost needs to be added to the > optimizer's arsenal of tricks. And I'd agree with you: That WOULD be a > better solution than hints. But I need my problem solved TODAY, not > next year. Hints can help solve problems NOW that can be brought to the > PG team's attention later, and in the mean time let me get my > application to work. Craig