Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id E2A9E9FB399 for ; Thu, 12 Oct 2006 16:34:20 -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 93388-02 for ; Thu, 12 Oct 2006 16:34:17 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id D824A9FB33B for ; Thu, 12 Oct 2006 16:34:16 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 0268956427; Thu, 12 Oct 2006 14:34:15 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Thu, 12 Oct 2006 14:34:15 -0500 Date: Thu, 12 Oct 2006 14:34:15 -0500 From: "Jim C. Nasby" To: Jeff Davis Cc: pgsql-performance@postgresql.org Subject: Re: Hints proposal Message-ID: <20061012193414.GV28647@nasby.net> References: <20061012151439.GT28647@nasby.net> <1160671375.31966.84.camel@dogma.v10.wvs> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1160671375.31966.84.camel@dogma.v10.wvs> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:061012:pgsql@j-davis.com::NLWFOUcVl19T2k5C:00000000000000000000 0000000000000000000000000Nth X-Hashcash: 1:20:061012:pgsql-performance@postgresql.org::2yzGyTJfasDrK4l1:00000 0000000000000000000000007gKj X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.051 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200610/258 X-Sequence-Number: 21387 On Thu, Oct 12, 2006 at 09:42:55AM -0700, Jeff Davis wrote: > On Thu, 2006-10-12 at 10:14 -0500, Jim C. Nasby wrote: > > The syntax these hints is something arbitrary. I'm borrowing Oracle's > > idea of embedding hints in comments, but we can use some other method if > > desired. Right now I'm more concerned with getting the general idea > > across. > > > > Is there any advantage to having the hints in the queries? To me that's > asking for trouble with no benefit at all. It would seem to me to be > better to have a system catalog that defined hints as something like: > > "If user A executes a query matching regex R, then coerce (or force) the > planner in this way." > > I'm not suggesting that we do that, but it seems better then embedding > the hints in the queries themselves. My experience is that on the occasions when I want to beat the planner into submission, it's usually a pretty complex query that's the issue, and that it's unlikely to have more than a handful of them in the application. That makes me think a regex facility would just get in the way, but perhaps others have much more extensive need of hinting. I also suspect that writing that regex could become a real bear. Having said that... I see no reason why it couldn't work... but the real challenge is defining the hints. -- Jim Nasby jim@nasby.net EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)