Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 3504C9FB1DD for ; Thu, 12 Oct 2006 13:22:16 -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 70874-04 for ; Thu, 12 Oct 2006 13:22:12 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) by postgresql.org (Postfix) with ESMTP id 4553F9FB379 for ; Thu, 12 Oct 2006 13:22:12 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id 30so297390ugc for ; Thu, 12 Oct 2006 09:22:11 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=gg+amXZ0j8vNor6K9zsEClkZOl3oxLbKrao1RKoxDNkv0t7dWsIW8mbztThm47oWxGD4+VBCGzwclpnrLcBqN8+BmhKjRkJHdGtfco0OdRuqcJu23WrWF05bpiTyStuvGC/gP66qmhvxba9a3NE3yvnISjCRqjRzyer0wfUmOf0= Received: by 10.78.131.8 with SMTP id e8mr2419371hud; Thu, 12 Oct 2006 09:22:10 -0700 (PDT) Received: by 10.78.35.18 with HTTP; Thu, 12 Oct 2006 09:22:10 -0700 (PDT) Message-ID: Date: Thu, 12 Oct 2006 12:22:10 -0400 From: "Merlin Moncure" To: pgsql-hackers@postgresql.org Subject: Re: Hints proposal Cc: "Jim C. Nasby" , pgsql-performance@postgresql.org In-Reply-To: <10866.1160667752@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20061012151439.GT28647@nasby.net> <10866.1160667752@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.229 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/238 X-Sequence-Number: 21367 On 10/12/06, Tom Lane wrote: > [ This is off-topic for -performance, please continue the thread in > -hackers ] > This proposal seems to deliberately ignore every point that has been > made *against* doing things that way. It doesn't separate the hints > from the queries, it doesn't focus on fixing the statistical or cost > misestimates that are at the heart of the issue, and it takes no account > of the problem of hints being obsoleted by system improvements. what about extending the domain system so that we can put in ranges that override the statistics or (imo much more importantly) provide information when the planner would have to restort to a guess. my case for this is prepared statements with a parameterized limit clause. prepare foo(l int) as select * from bar limit $1; maybe: create domain foo_lmt as int hint 1; -- probably needs to be fleshed out prepare foo(l foolmt) as select * from bar limit $1; this says: "if you have to guess me, please use this" what I like about this over previous attempts to persuade you is the grammar changes are localized and also imo future proofed. planner can ignore the hints if they are not appropriate for the oparation. merlin