Re: [PERFORM] Why we don't want hints Was: Slow count(*) again...

2011-02-10 Thread Tom Lane
Tobias Brox writes: > I have no clue about how hints works in Oracle ... I've never been > working "enterprise level" on anything else than Postgres. Anyway, > today I just came over an interesting problem in our production > database today - and I think it would be a benefit to be able to > expl

Re: [PERFORM] Why we don't want hints Was: Slow count(*) again...

2011-02-10 Thread Tobias Brox
On 4 February 2011 04:46, Josh Berkus wrote: > "Optimizer hints are used to work around problems in the optimizer and > introduce upgrade and maintenance issues. We would rather have the > problems reported and fixed. We have discussed a more sophisticated > system of per-class cost adjustment ins

Re: [PERFORM] Why we don't want hints Was: Slow count(*) again...

2011-02-10 Thread Craig James
On 2/10/11 9:21 AM, Kevin Grittner wrote: Shaun Thomas wrote: how difficult would it be to add that syntax to the JOIN statement, for example? Something like this syntax?: JOIN WITH (correlation_factor=0.3) Where 1.0 might mean that for each value on the left there was only one distinct va

Re: [PERFORM] Why we don't want hints Was: Slow count(*) again...

2011-02-10 Thread Kevin Grittner
Greg Smith wrote: > Shaun Thomas wrote: >> Hilariously, I'm not so sure that's what the OP wanted. > > Someone to blame as a scapegoat for why his badly planned project > had failed. I've done several Oracle conversions before, and > never met someone who was so resistent to doing the right thi

Re: [PERFORM] Why we don't want hints

2011-02-10 Thread Chris Browne
robertmh...@gmail.com (Robert Haas) writes: > On Thu, Feb 10, 2011 at 11:45 AM, Kevin Grittner > wrote: >> 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 th

Re: [PERFORM] Why we don't want hints Was: Slow count(*) again...

2011-02-10 Thread Greg Smith
Shaun Thomas wrote: Hilariously, I'm not so sure that's what the OP wanted. Someone to blame as a scapegoat for why his badly planned project had failed. I've done several Oracle conversions before, and never met someone who was so resistent to doing the right things for such a conversion.

Re: [PERFORM] Does auto-analyze work on dirty writes?

2011-02-10 Thread Robert Haas
On Fri, Feb 4, 2011 at 8:50 PM, Mark Mielke wrote: > On 02/04/2011 10:41 AM, Tom Lane wrote: >> >> 1. Autovacuum fires when the stats collector's insert/update/delete >> counts have reached appropriate thresholds.  Those counts are >> accumulated from messages sent by backends at transaction commi

Re: [PERFORM] Why we don't want hints Was: Slow count(*) again...

2011-02-10 Thread Kevin Grittner
Shaun Thomas wrote: > I was thinking more: > > JOIN foo_tab USING (foo_id) WITH (COST=50) The problem I have with that syntax is that it would be hard to read when you have some nested set of joins or a (SELECT) in the JOIN instead of simple table name. For me, at least, it would "get lost"

Re: [PERFORM] Why we don't want hints Was: Slow count(*) again...

2011-02-10 Thread Shaun Thomas
On 02/10/2011 11:21 AM, Kevin Grittner wrote: Something like this syntax?: JOIN WITH (correlation_factor=0.3) I was thinking more: JOIN foo_tab USING (foo_id) WITH (COST=50) or something, to exploit the hooks that already exist for functions, for example. But it's still an interesting conc

Re: [PERFORM] Why we don't want hints Was: Slow count(*) again...

2011-02-10 Thread Kevin Grittner
Robert Haas wrote: >> 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 That sounds pretty g

Re: [PERFORM] Why we don't want hints Was: Slow count(*) again...

2011-02-10 Thread Kevin Grittner
Shaun Thomas wrote: > how difficult would it be to add that syntax to the JOIN > statement, for example? Something like this syntax?: JOIN WITH (correlation_factor=0.3) Where 1.0 might mean that for each value on the left there was only one distinct value on the right, and 0.0 would mean t

Re: [PERFORM] Why we don't want hints Was: Slow count(*) again...

2011-02-10 Thread Robert Haas
On Thu, Feb 10, 2011 at 12:01 PM, Tom Lane wrote: > "Kevin Grittner" writes: >> Robert Haas 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

Re: [PERFORM] Why we don't want hints Was: Slow count(*) again...

2011-02-10 Thread Shaun Thomas
On 02/10/2011 11:01 AM, Tom Lane wrote: But I'm not interested in implementing Oracle-like hints just because Oracle has them, which I think was basically what the OP wanted. Hilariously, I'm not so sure that's what the OP wanted. Several of us pointed him to EnterpriseDB and their Oracle-sty

Re: [PERFORM] Why we don't want hints Was: Slow count(*) again...

2011-02-10 Thread Shaun Thomas
On 02/10/2011 10:45 AM, Kevin Grittner wrote: Even there I would tend to think that the sort of "do it this way" hints that people seem to initially want wouldn't be good; it should be a way to override the costing factor which the optimizer gets wrong, so it can do its usual excellent job of ev

Re: [PERFORM] Why we don't want hints Was: Slow count(*) again...

2011-02-10 Thread Robert Haas
On Thu, Feb 10, 2011 at 11:45 AM, Kevin Grittner wrote: > 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. > From both on-list posts and

Re: [PERFORM] Why we don't want hints Was: Slow count(*) again...

2011-02-10 Thread Tom Lane
"Kevin Grittner" writes: > Robert Haas 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

Re: [PERFORM] Why we don't want hints Was: Slow count(*) again...

2011-02-10 Thread Kevin Grittner
Robert Haas wrote: > I think it's just dumb to say we don't want hints. We want hints, > or at least many of us do. Well, yeah. Even those most ostensibly opposed to hints have been known to post that they would rather not have the optimizer recognize two logically equivalent constructs and

Re: [PERFORM] Why we don't want hints Was: Slow count(*) again...

2011-02-10 Thread Robert Haas
On Thu, Feb 3, 2011 at 8:46 PM, Josh Berkus wrote: > "Optimizer hints are used to work around problems in the optimizer and > introduce upgrade and maintenance issues. We would rather have the > problems reported and fixed. We have discussed a more sophisticated > system of per-class cost adjustme