Re: Why we don't want hints Was: Slow count(*) again... - Mailing list pgsql-performance

From Robert Haas
Subject Re: Why we don't want hints Was: Slow count(*) again...
Date
Msg-id AANLkTikM8j8R75G2Ji-r59Oxq86a12HchpVtR28hJ-6i@mail.gmail.com
Whole thread Raw
In response to Re: Why we don't want hints Was: Slow count(*) again...  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Why we don't want hints Was: Slow count(*) again...  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-performance
On Thu, Feb 10, 2011 at 12:01 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
>> Robert Haas <robertmhaas@gmail.com> wrote:
>>> I don't know exactly what the right solution is off the top of my
>>> head, but digging in our heels is not it.
>
>> Well, I'm comfortable digging in my heels against doing *lame* hints
>> just because "it's what all the other kids are doing," which I think
>> is the only thing which would have satisfied the OP on this thread.
>
> Right.  If someone comes up with a design that avoids the serious
> pitfalls of traditional hinting schemes, that'd be great.  But I'm
> not interested in implementing Oracle-like hints just because Oracle
> has them, which I think was basically what the OP wanted.  I haven't
> seen a hinting scheme that didn't suck (and that includes the aspects
> of our own current behavior that are hint-like).  I don't say that
> there can't be one.
>
> I believe that the FAQ entry is meant to answer people who come along
> and say "oh, this is easily solved, just do what $PRODUCT does".  The
> generic answer to that is "no, it's not that easy".  But maybe the FAQ
> should be rephrased to be more like "we don't want traditional hints
> because of problems X, Y, and Z.  If you have an idea that avoids those
> problems, let us know."

That's closer to where I think the community is on this issue, for sure.

Frankly, I think we should also have some much better documentation
about how to fix problems in the optimizer.  Before the OP went off on
a rant, he actually showed up at a webinar I did looking for advice on
how to fix queries in PG, which wasn't exactly the topic of the
webinar, so he didn't get his answer.  But the only way you're going
to find out about a lot of the tricks that we rely on is to read the
mailing lists, and that's below our usual standard of documentation.
Sure, it's a bunch of ugly hacks, but they're useful when you're being
eaten by a crocodile, and the need for them isn't limited to people
who have time to spend all day reading pgsql-whatever.

I also think that we have enough knowledge between us to identify the
areas where some better hints, or hint-ish mechanisms, would actually
be useful.  I feel like I have a pretty good idea where the bodies are
buried, and what some of the solutions might look like.  But I'm not
sure I want to open that can of worms while we're trying to close out
this CommitFest.  In fact I'm pretty sure I don't.  But I would like
to change the Todo text to say something less misleading.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

pgsql-performance by date:

Previous
From: Shaun Thomas
Date:
Subject: Re: Why we don't want hints Was: Slow count(*) again...
Next
From: "Kevin Grittner"
Date:
Subject: Re: Why we don't want hints Was: Slow count(*) again...