Re: Hints proposal

From: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Hints proposal
Date: 2006-10-12 19:34:15
Message-ID: 20061012193414.GV28647@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

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(at)nasby(dot)net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-10-12 19:42:24 pgsql: Stamp 7.3.16.
Previous Message Jim C. Nasby 2006-10-12 19:24:10 Re: [HACKERS] Hints proposal

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2006-10-12 20:58:22 Re: [HACKERS] Hints proposal
Previous Message Jim C. Nasby 2006-10-12 19:24:10 Re: [HACKERS] Hints proposal